/**
 * @note 设置高级查询面板上偏移量
 * @param element1：参照物元素
 * @param element2：偏移目标元素
 * @author 吴义迪
 * @create_time 2017-07-06
 */
function setAdvancedQueryDivTop(element1, element2){
	var height = element1.offset().top - 10;
	var divHeight = element2.outerHeight();
	var bottomHeight = $(window).height() - $("#accordion").outerHeight() - 20;
	if((height + divHeight) > $(window).height()-bottomHeight){
		height = height - ((height + divHeight)-($(window).height()-bottomHeight));
	}
	if(height < 20){
		height = 20;
	}
	element2.css("top", height+"px");
}

/**
 * @note 加载高级查询面板1
 * @param id：图层id
 * @author 吴义迪
 * @create_time 2017-07-06
 */
function loadAdvancedQueryDiv1(id){
	var name = $("#tree_li_"+id+"").attr("layername");
	var parentNodeName = $("#tree_li_"+($("#tree_li_"+id+"").attr("fid"))+"").attr("layername");
	$(".menu1_div").hide();
	if($("#tree_li_"+id+"_advancedQueryDiv").length > 0){
		$("#tree_li_"+id+"_advancedQueryDiv").show();
	}else{
		var left = 331;
		var html = "";
		Global.common.time = timeFormat1(new Date()).substring(0, 10);
		var param = getTimeParam(id, "DAY");
			initTime(id, param.value, param.index, param.index1, false);
		html =  "<div id=\"tree_li_"+id+"_advancedQueryDiv\" class=\"menu1_div\" " +
				"     style=\"position:absolute; left:"+left+"px; background:#fff; padding:10px; " +
				"	          border-radius:4px; z-index:10;\">" +
				"	<div id=\"advancedQuery_header_"+id+"_div\">";
		if(id == 58){
			html += "		<div><span><b>农情调查</b><span></div>";
		}else{
			html += "		<div><span><b>灾情调查</b><span></div>";
		}						
			html +=	"		<hr style=\"margin: 6px 0; border-top:1px solid #ccc;\"/>" +
				"	</div>" +
				"	<div>" +
				"		<b>作物类型: </b>";
				if( id == "58" ){
					html += "<select id=\"farmselect\" style=\"width: 100px;\" onchange=\"requestNPointLayer($('#farmselect').val())\">";
				} else if( id == "233" ){
					html += "<select id=\"farmselect\" style=\"width: 100px;\" onchange=\"requestZPointLayer($('#farmselect').val())\">";
				}				
		html +=	"		</select>" +
				"	</div>" +
				"	<ul id=\"farmdetail\" style=\"width: 102%; list-style-type: none; height: 180px; overflow-x: hidden;overflow-y: auto; text-overflow: ellipsis; white-space:nowrap;\">" +
				"	</ul>" +
				"	<span id=\"menu1_div_"+id+"_exit\" class=\"menu1_div_exit\">×</span>" +
				"</div>";
		$("body").append(html);		
		var farmselect = document.querySelector("#farmselect"),	
			farmselecthtml = "";
		var farmdetail = document.querySelector("#farmdetail"),	
			farmdetailhtml = "";
		addTimeAxis(id);
		if( id == "58" ){ //农情
			farmselecthtml = "<option value=\"all1\">全部</option>";
			//农事调查-农情调查
			$.ajax({
				url: "http://39.107.24.230:8020/ChinaAPP/CropController/getAllCrops?levels=2",
				type: "get",
				dataType: "json",
				timeout: 3500,
				async: false,
				success:function(result){
					if(result.isSuccess){
						Global.common.farmnum = [];
						Config.layerTypeT += "all1,";	
						for(i=0;i<result.data.length;i++){
							farmselecthtml += "<option value=\""+result.data[i].id+"\">"+result.data[i].name+"</option>";
							Config.layerTypeT += ""+result.data[i].id+",";													
						}
						farmselect.innerHTML = farmselecthtml;
					}
				},
				error:function(){
					window.console.log("请求数据异常");//异常处理
				}						
			});	
			requestNPointLayer("all1");
			$("#tree_li_"+id+"").attr("timeaxis", "1");			
		} else if( id == "233"){ //灾情
			farmselecthtml = "<option value=\"all3\">全部</option>";
			//农事调查-灾情调查
			$.ajax({
				url: "http://39.107.24.230:8020/ChinaAPP/DisasterTypeController/getAllDisasterType",
				type: "get",
				dataType: "json",
				timeout: 3500,
				async: false,
				success:function(result){
					if(result.isSuccess){
						Config.layerTypeZ += "all3,";
						for(i=0;i<result.data.length;i++){
							farmselecthtml += "<option value=\""+result.data[i].disastercode+"\">"+result.data[i].disastertype+"</option>";
							Config.layerTypeZ += ""+result.data[i].disastercode+",";											
						}753
						farmselect.innerHTML = farmselecthtml;
					}
				},	
				error:function(){
					window.console.log("请求数据异常");//异常处理
				}					
			});
			requestZPointLayer("all3");
			$("#tree_li_"+id+"").attr("timeaxis", "1");
		}												
		// $("#tree_li_"+id+"_advancedQueryDiv").css("left", "15px");
		// $("#tree_li_"+id+"_advancedQueryDiv").css("top", "15px");	
		 $("#tree_li_"+id+"_advancedQueryDiv").hide();		
		//点击事件
		$("#tree_li_"+id+"_advancedQueryDiv").on("click", {"id":id}, advancedQuery1ClickFunc);
	}
	//设置时间尺度选中效果
	$("#advancedQuery_time_"+id+">span:eq("+Config[id].initTimeType+")").css({"color":"#fff", "background-color":"#4187e7"});	
	$("#advancedQuery_time_"+id+">span:eq("+Config[id].initTimeType+")").attr("flag", "1");

	for(var i=0; i<Config[id].timeArray.length; i++){
		if(i == Config[id].initTimeType){
			$("#advancedQuery_type_"+id+"").append(
				"<div id=\"advancedQuery_type_div"+(i+1)+"_"+id+"\"></div>"
			);
		}else{
			$("#advancedQuery_type_"+id+"").append(
				"<div id=\"advancedQuery_type_div"+(i+1)+"_"+id+"\" style=\"display:none;\"></div>"
			);
		}

	}
	//设置高级查询面板上偏移量
	setAdvancedQueryDivTop($("#tree_li_"+id+"_img5"), $("#tree_li_"+id+"_advancedQueryDiv"));
}

/**
 * @note 高级查询面板1点击监听事件
 * @author 吴义迪
 * @create_time 2017-07-06
 */
function advancedQuery1ClickFunc(e){
	e = e || window.event;
	var id = e.data.id;
	//退出
	if(e.target.id == "menu1_div_"+id+"_exit"){
		$("#tree_li_"+id+"_advancedQueryDiv").hide();
	}
}

/**
 * @note 加载高级查询面板2
 * @author 吴义迪
 * @create_time 2017-07-30
 */
function loadAdvancedQueryDiv2(id){
	var name = $("#tree_li_"+id+"").attr("layername");
	var parentNodeName = $("#tree_li_"+($("#tree_li_"+id+"").attr("fid"))+"").attr("layername");
	$(".menu1_div").hide();
	if($("#tree_li_"+id+"_advancedQueryDiv").length > 0){
		$("#tree_li_"+id+"_advancedQueryDiv").show();
	} else if(id == '58' && id == '233'){
		var left = 331;
		var html = "";
		html =  "<div id=\"tree_li_"+id+"_advancedQueryDiv\" class=\"menu1_div\" " +
				"     style=\"position:absolute; left:"+left+"px; background:#fff; padding:10px; " +
				"	          border-radius:4px; z-index:10;\">" +
				"	<div id=\"advancedQuery_header_"+id+"_div\">" +
				"		<div><span><b>"+parentNodeName+" - "+name+"</b><span></div>" +
				"		<hr style=\"margin: 6px 0; border-top:1px solid #ccc;\"/>" +
				"	</div>" +
				"	<div id=\"advancedQuery_type_"+id+"_div\">" +
				"		<div><span><b id=\"advancedQuery_type_b_"+id+"\">指标类型</b></span></div>" +
				"		<div id=\"advancedQuery_type_"+id+"\" class=\"advancedQuery_div1\"></div>" +
				"	</div>" +
				"	<div id=\"advancedQuery_opacitySlider_"+id+"_div\">" +
				"		<div><span><b>透明度</b></span></div>" +
				"		<div id=\"opacitySlider_"+id+"\" class=\"opacitySlider\" value=\""+id+"\"></div>" +
				"		<span id=\"opacitySliderValue_"+id+"\" class=\"opacitySliderValue\"></span>" +
				"	</div>" +
				"	<span id=\"menu1_div_"+id+"_exit\" class=\"menu1_div_exit\">×</span>" +
				"</div>";
		$("body").append(html);
		//根据图层id加载高级查询面板1内容
		loadAdvancedQueryDiv2ContentById(id);
	}else{
		var left = 331;
		var html = "";
		html =  "<div id=\"tree_li_"+id+"_advancedQueryDiv\" class=\"menu1_div\" " +
				"     style=\"position:absolute; left:"+left+"px; background:#fff; padding:10px; " +
				"	          border-radius:4px; z-index:10;\">" +
				"	<div id=\"advancedQuery_header_"+id+"_div\">" +
				"		<div><span><b>"+parentNodeName+" - "+name+"</b><span></div>" +
				"		<hr style=\"margin: 6px 0; border-top:1px solid #ccc;\"/>" +
				"	</div>" +
				"	<div id=\"advancedQuery_type_"+id+"_div\">" +
				"		<div><span><b id=\"advancedQuery_type_b_"+id+"\">指标类型</b></span></div>" +
				"		<div id=\"advancedQuery_type_"+id+"\" class=\"advancedQuery_div1\"></div>" +
				"	</div>" +
				"	<div id=\"advancedQuery_opacitySlider_"+id+"_div\">" +
				"		<div><span><b>透明度</b></span></div>" +
				"		<div id=\"opacitySlider_"+id+"\" class=\"opacitySlider\" value=\""+id+"\"></div>" +
				"		<span id=\"opacitySliderValue_"+id+"\" class=\"opacitySliderValue\"></span>" +
				"	</div>" +
				"	<span id=\"menu1_div_"+id+"_exit\" class=\"menu1_div_exit\">×</span>" +
				"</div>";
		$("body").append(html);
		//根据图层id加载高级查询面板1内容
		loadAdvancedQueryDiv2ContentById(id);
	}
}

/**
 * @note 根据图层id加载高级查询面板2内容
 * @param id：图层id
 * @author 吴义迪
 * @create_time 2017-07-30
 */
function loadAdvancedQueryDiv2ContentById(id){
	//指标类型标题拼写
	$("#advancedQuery_type_b_"+id+"").html(Config[id].typeName);
	if(Config[id].typeArray.length <= 0){
		$("#advancedQuery_type_"+id+"_div").hide();
	}else{
		var typeHtml = "";
		for(var j=0; j<Config[id].typeArray.length; j++){
			if(j % 2 == 0 && j != 0){
				typeHtml += "<br/>";
			}
			if((j + 1) % 2 == 0){
				typeHtml += "<span class=\"advancedQuery_type_span1\" name=\"advancedQuery_type_span_"+id+"\" index=\""+j+"\" param=\""+Config[id].typeParam[j]+"\" title=\""+Config[id].typeArray[j]+"\">"+Config[id].typeArray[j]+"</span>";
			}else{
				typeHtml += "<span class=\"advancedQuery_type_span\" name=\"advancedQuery_type_span_"+id+"\" index=\""+j+"\" param=\""+Config[id].typeParam[j]+"\" title=\""+Config[id].typeArray[j]+"\">"+Config[id].typeArray[j]+"</span>";
			}
		}
		$("#advancedQuery_type_"+id+"").html(typeHtml);
	}
	$("#advancedQuery_type_"+id+">span:eq("+Config[id].initType+")").css({"color":"#fff", "background-color":"#4187e7"});
	//设置透明度
	$("#opacitySlider_"+id+"").slider({
		range: "min",
		max: 100,
		change: refreshSlider
	});
	//初始透明度显示
	$("#opacitySlider_"+id+"").slider("value", $("#tree_li_"+id).attr("opacity"));
	if(Config[id].opacity == null){
		$("#advancedQuery_opacitySlider_"+id+"_div").hide();
	}
	//设置高级查询面板上偏移量
	setAdvancedQueryDivTop($("#tree_li_"+id+"_img5"), $("#tree_li_"+id+"_advancedQueryDiv"));
	//点击事件
	$("#tree_li_"+id+"_advancedQueryDiv").on("click", {"id":id}, advancedQuery2ClickFunc);
}

/**
 * @note 加载高级查询面板3
 * @author 吴义迪
 * @create_time 2017-08-06
 */
function loadAdvancedQueryDiv3(id){
	var name = $("#tree_li_"+id+"").attr("layername");
	var parentNodeName = $("#tree_li_"+($("#tree_li_"+id+"").attr("fid"))+"").attr("layername");
	$(".menu1_div").hide();
	if($("#tree_li_"+id+"_advancedQueryDiv").length > 0){
		$("#tree_li_"+id+"_advancedQueryDiv").show();
	}else{
		var left = 331;
		var html = "";
		html =  "<div id=\"tree_li_"+id+"_advancedQueryDiv\" class=\"menu1_div\" " +
				"     style=\"position:absolute; left:"+left+"px; background:#fff; padding:10px; " +
				"	          border-radius:4px; z-index:10; display:none;\">" +
				"	<div id=\"advancedQuery_header_"+id+"_div\">" +
				"		<div><span><b>"+parentNodeName+" - "+name+"</b><span></div>" +
				"		<hr style=\"margin: 6px 0; border-top:1px solid #ccc;\"/>" +
				"	</div>" +
				"	<div id=\"advancedQuery_time_"+id+"_div\">" +
				"		<div><span><b>时间尺度</b></span></div>" +
				"		<div id=\"advancedQuery_time_"+id+"\" class=\"advancedQuery_div\"></div>" +
				"	</div>" +
				"	<div id=\"advancedQuery_type_"+id+"_div\">" +
				"		<div><span><b id=\"advancedQuery_type_b_"+id+"\">指标类型</b></span></div>" +
				"		<div id=\"advancedQuery_type_"+id+"\" class=\"advancedQuery_div1\"></div>" +
				"	</div>" +
				"	<div id=\"advancedQuery_meteoShowType_"+id+"_div\">" +
				"		<div><span><b>要素控制</b></span></div>" +
				"		<div id=\"advancedQuery_meteoShowType_"+id+"\" class=\"advancedQuery_div1\"></div>" +
				"	</div>" +
				"	<div id=\"advancedQuery_stationShowType_"+id+"_div\">" +
				"		<div><span><b>站点控制</b></span></div>" +
				"		<div id=\"advancedQuery_stationShowType_"+id+"\" class=\"advancedQuery_div1\"></div>" +
				"	</div>" +
				"	<div id=\"advancedQuery_layerOperation_"+id+"_div\">" +
				"		<div><span><b>图层操作</b></span></div>" +
				"		<div id=\"advancedQuery_layerOperation_"+id+"\" class=\"advancedQuery_div1\"></div>" +
				"	</div>" +
				"	<div id=\"advancedQuery_opacitySlider_"+id+"_div\">" +
				"		<div><span><b>透明度</b></span></div>" +
				"		<div id=\"opacitySlider_"+id+"\" class=\"opacitySlider\" value=\""+id+"\"></div>" +
				"		<span id=\"opacitySliderValue_"+id+"\" class=\"opacitySliderValue\"></span>" +
				"	</div>" +
				"	<span id=\"menu1_div_"+id+"_exit\" class=\"menu1_div_exit\">×</span>" +
				"</div>";
		$("body").append(html);
		//根据图层id加载高级查询面板1内容
		loadAdvancedQueryDiv3ContentById(id);
	}
}

/**
 * @note 加载 农情/灾情高级面板
 * @author 吴义迪
 * @create_time 2017-08-06
 */
function loadAdvancedQueryDivN(id){
	var name = $("#tree_li_"+id+"").attr("layername");
	var parentNodeName = $("#tree_li_"+($("#tree_li_"+id+"").attr("fid"))+"").attr("layername");
	$(".menu1_div").hide();
	if($("#tree_li_"+id+"_advancedQueryDiv").length > 0){
		$("#tree_li_"+id+"_advancedQueryDiv").show();
	}else{
		var left = 331;
		var html = "";
		if( id == "58"){
			html =  "<div id=\"tree_li_"+id+"_advancedQueryDiv\" class=\"menu1_div\" " +
				"     style=\"position:absolute; left:"+left+"px; background:#fff; padding:10px; " +
				"	          border-radius:4px; z-index:10; display:none;\">" +
				"	<div id=\"advancedQuery_header_"+id+"_div\">" +
				"		<div><span><b>"+parentNodeName+" - "+name+"</b><span></div>" +
				"		<hr style=\"margin: 6px 0; border-top:1px solid #ccc;\"/>" +
				"	</div>" +
				"	<div id=\"advancedQuery_time_"+id+"_div\">" +
				"		<div><span><b>农情类型</b></span></div>" +
				"		<div id=\"advancedQuery_time_"+id+"\" class=\"advancedQuery_div\"></div>" +
				"	</div>" +
				"	<div id=\"advancedQuery_type_"+id+"_div\">" +
				"		<div><span><b id=\"advancedQuery_type_b_"+id+"\">农情类型</b></span></div>" +
				"		<div id=\"advancedQuery_type_"+id+"\" class=\"advancedQuery_div1\"></div>" +
				"	</div>" +
				"	<div id=\"advancedQuery_meteoShowType_"+id+"_div\">" +
				"		<div><span><b>灾情类型</b></span></div>" +
				"		<div id=\"advancedQuery_meteoShowType_"+id+"\" class=\"advancedQuery_div1\"></div>" +
				"	</div>" +
				"	<div id=\"advancedQuery_stationShowType_"+id+"_div\">" +
				"		<div><span><b>站点控制</b></span></div>" +
				"		<div id=\"advancedQuery_stationShowType_"+id+"\" class=\"advancedQuery_div1\"></div>" +
				"	</div>" +
				"	<div id=\"advancedQuery_layerOperation_"+id+"_div\">" +
				"		<div><span><b>图层操作</b></span></div>" +
				"		<div id=\"advancedQuery_layerOperation_"+id+"\" class=\"advancedQuery_div1\"></div>" +
				"	</div>" +
				// "	<div id=\"advancedQuery_opacitySlider_"+id+"_div\">" +
				// "		<div><span><b>透明度</b></span></div>" +
				// "		<div id=\"opacitySlider_"+id+"\" class=\"opacitySlider\" value=\""+id+"\"></div>" +
				// "		<span id=\"opacitySliderValue_"+id+"\" class=\"opacitySliderValue\"></span>" +
				// "	</div>" +
				// "	<span id=\"menu1_div_"+id+"_exit\" class=\"menu1_div_exit\">×</span>" +
				"</div>";
		} else {
			html =  "<div id=\"tree_li_"+id+"_advancedQueryDiv\" class=\"menu1_div\" " +
				"     style=\"position:absolute; left:"+left+"px; background:#fff; padding:10px; " +
				"	          border-radius:4px; z-index:10; display:none;\">" +
				"	<div id=\"advancedQuery_header_"+id+"_div\">" +
				"		<div><span><b>"+parentNodeName+" - "+name+"</b><span></div>" +
				"		<hr style=\"margin: 6px 0; border-top:1px solid #ccc;\"/>" +
				"	</div>" +
				"	<div id=\"advancedQuery_time_"+id+"_div\">" +
				"		<div><span><b>农情类型</b></span></div>" +
				"		<div id=\"advancedQuery_time_"+id+"\" class=\"advancedQuery_div\"></div>" +
				"	</div>" +
				"	<div id=\"advancedQuery_type_"+id+"_div\">" +
				"		<div><span><b id=\"advancedQuery_type_b_"+id+"\">灾情类型</b></span></div>" +
				"		<div id=\"advancedQuery_type_"+id+"\" class=\"advancedQuery_div1\"></div>" +
				"	</div>" +
				"	<div id=\"advancedQuery_meteoShowType_"+id+"_div\">" +
				"		<div><span><b>要素控制</b></span></div>" +
				"		<div id=\"advancedQuery_meteoShowType_"+id+"\" class=\"advancedQuery_div1\"></div>" +
				"	</div>" +
				"	<div id=\"advancedQuery_stationShowType_"+id+"_div\">" +
				"		<div><span><b>站点控制</b></span></div>" +
				"		<div id=\"advancedQuery_stationShowType_"+id+"\" class=\"advancedQuery_div1\"></div>" +
				"	</div>" +
				"	<div id=\"advancedQuery_layerOperation_"+id+"_div\">" +
				"		<div><span><b>图层操作</b></span></div>" +
				"		<div id=\"advancedQuery_layerOperation_"+id+"\" class=\"advancedQuery_div1\"></div>" +
				"	</div>" +
				// "	<div id=\"advancedQuery_opacitySlider_"+id+"_div\">" +
				// "		<div><span><b>透明度</b></span></div>" +
				// "		<div id=\"opacitySlider_"+id+"\" class=\"opacitySlider\" value=\""+id+"\"></div>" +
				// "		<span id=\"opacitySliderValue_"+id+"\" class=\"opacitySliderValue\"></span>" +
				// "	</div>" +
				// "	<span id=\"menu1_div_"+id+"_exit\" class=\"menu1_div_exit\">×</span>" +
				"</div>";
		}		
		$("body").append(html);
		//根据图层id加载高级查询面板1内容
		loadAdvancedQueryDivNContentById(id);
	}
}

/**
 * @note 根据图层id加载高级查询面板3内容
 * @author 吴义迪
 * @create_time 2017-08-06
 */
function loadAdvancedQueryDivNContentById(id){
	//html拼写
	var html1 = "";
	var html2 = "";
	var html3 = "";
	var html5 = "";
	var htmlArray = [];
	//指标类型标题拼写
	$("#advancedQuery_type_b_"+id+"").html(Config[id].typeName);
	// if(Config[id].typeArray.length <= 0){
	// 	$("#advancedQuery_type_"+id+"_div").hide();
	// }else{
		if( id == 58 ){
			//农事调查-农情调查
			$.ajax({
				url: "http://39.107.24.230:8020/ChinaAPP/CropController/getAllCrops?levels=2",
				type: "get",
				dataType: "json",
				timeout: 3500,
				async: false,
				success:function(result){
					if(result.isSuccess){
						Config[id].typeArray = [];
						Config[id].typeParam = [];
						Global.common.farmnum = [];
						var typearray = [],
							typeParam = [];
						typearray[0] = "全部";
						typeParam[0] = "all1";	
						Config.layerTypeT += "all1,";	
						for(i=0;i<result.data.length;i++){
								typearray[i+1] = result.data[i].name;
								typeParam[i+1] = result.data[i].id	
								Config.layerTypeT += ""+result.data[i].id+",";													
						}
						Config[id].typeArray.push(typearray);
						Config[id].typeParam.push(typeParam);
					}
				},
				error:function(){
					window.console.log("请求数据异常");//异常处理
				}				
			});
		}else if( id == 233 ){
			$.ajax({
				url: "http://39.107.24.230:8020/ChinaAPP/CropController/getAllCrops?levels=2",
				type: "get",
				dataType: "json",
				timeout: 3500,
				async: false,
				success:function(result){
					if(result.isSuccess){
						Config[id].timeArray = [];
						Config[id].timeParam = [];
						var timearray = [],
						timeParam = [];
						for(i=0;i<result.data.length;i++){
							timearray[i] = result.data[i].name;
							timeParam[i] = result.data[i].id	
							Config.layerTypeZ += ""+result.data[i].id+",";						
						}
						Config[id].timeArray = timearray;//.push(timearray);
						Config[id].timeParam = timeParam;//.push(timeParam);
					}
				},
				error:function(){
					window.console.log("请求数据异常");//异常处理
				}						
			});
			//农事调查-灾情调查
			$.ajax({
				url: "http://39.107.24.230:8020/ChinaAPP/DisasterTypeController/getAllDisasterType",
				type: "get",
				dataType: "json",
				timeout: 3500,
				async: false,
				success:function(result){
					if(result.isSuccess){
						Config[id].typeArray = [];
						Config[id].typeParam = [];
						Config[id].meteoShowTypeFlag = [];
						var typearray = [],
							typeParam = [];
						for(i=0;i<result.data.length;i++){
							typearray[i] = result.data[i].disastertype;
							typeParam[i] = result.data[i].disastercode	
							Config.layerTypeT += ""+result.data[i].disastercode+",";											
						}
						 var meteoarray = [];
						for(i=0;i<Config[id].timeArray.length;i++){
							Config[id].typeArray.push(typearray);
							Config[id].typeParam.push(typeParam);																	
						}
						for(i=0;i<Config[id].typeArray.length;i++){
							meteoarray[i] = "1";												
						}
						for(i=0;i<Config[id].timeArray.length;i++){
							Config[id].meteoShowTypeFlag.push(meteoarray);																	
						}
					}
				},	
				error:function(){
					window.console.log("请求数据异常");//异常处理
				}					
			});
		 } else if( id == 104 ){
			//农事调查-农情调查
			$.ajax({
				url: "http://39.107.24.230:8020/ChinaAPP/CropController/getAllCrops?levels=2",
				type: "get",
				dataType: "json",
				timeout: 3500,
				async: false,
				success:function(result){
					if(result.isSuccess){
						Config[id].typeArray = [];
						Config[id].typeParam = [];
						Global.common.farmnum = [];
						var typearray = [],
							typeParam = [];
						typearray[0] = "全部";
						typeParam[0] = "all2";	
						Config.layerTypeFarm += "all2,";	
						for(i=0;i<result.data.length;i++){
								typearray[i+1] = result.data[i].name;
								typeParam[i+1] = result.data[i].id	
								Config.layerTypeFarm += ""+result.data[i].id+",";													
						}
						Config[id].typeArray.push(typearray);
						Config[id].typeParam.push(typeParam);
					}
				},
				error:function(){
					window.console.log("请求数据异常");//异常处理
				}						
			});
		}
		 if(Config[id].timeArray.length <= 0){
			$("#advancedQuery_time_"+id+"_div").hide();
		 }else{
			if(Config[id].timeArray.length == 1){
				$("#advancedQuery_time_"+id+"_div").hide();
			}
			for(var i=0; i<Config[id].timeArray.length; i++){
				if(i % 4 == 0 && i != 0){
					html1 += "<br/>";
				}
				if((i + 1) % 4 == 0){
					html1 += "<span class=\"advancedQuery_time_span1\" name=\"advancedQuery_time_span_"+id+"\" index=\""+(i+1)+"\" param=\""+Config[id].timeParam[i]+"\">"+Config[id].timeArray[i]+"</span>";
				}else{
					html1 += "<span class=\"advancedQuery_time_span\" name=\"advancedQuery_time_span_"+id+"\" index=\""+(i+1)+"\" param=\""+Config[id].timeParam[i]+"\">"+Config[id].timeArray[i]+"</span>";
				}
			}
		 }	
		for(var i=0; i<Config[id].typeArray.length; i++){
			var typeHtml = "";
			for(var j=0; j<Config[id].typeArray[i].length; j++){
					if(j % 2 == 0 && j != 0){
						typeHtml += "<br/>";
					}
					if((j + 1) % 2 == 0){					
						typeHtml += "<span class=\"advancedQuery_type_span1\" name=\"advancedQuery_type_span_"+id+"\" index=\""+j+"\" param=\""+Config[id].typeParam[i][j]+"\" title=\""+Config[id].typeArray[i][j]+"\">"+Config[id].typeArray[i][j]+"</span>";
					}else{
						typeHtml += "<span class=\"advancedQuery_type_span\" name=\"advancedQuery_type_span_"+id+"\" index=\""+j+"\" param=\""+Config[id].typeParam[i][j]+"\" title=\""+Config[id].typeArray[i][j]+"\">"+Config[id].typeArray[i][j]+"</span>";
					}
			}			
			htmlArray.push(typeHtml);
		}
	//加载要素控制
	if(Config[id].meteoShowType == null || (Config[id].meteoShowType && Config[id].meteoShowType.length <= 0)){
		$("#advancedQuery_meteoShowType_"+id+"_div").hide();
	}else{
		for(var i=0; i<Config[id].meteoShowType.length; i++){
			if(i % 2 == 0 && i != 0){
				html2 += "<br/>";
			}
			if((i + 1) % 2 == 0){
				html2 += "<span class=\"advancedQuery_type_span1\" name=\"advancedQuery_showType_"+id+"\" param=\""+Config[id].meteoParam[i]+"\">"+Config[id].meteoShowType[i]+"</span>";
			}else{
				html2 += "<span class=\"advancedQuery_type_span\" name=\"advancedQuery_showType_"+id+"\" param=\""+Config[id].meteoParam[i]+"\">"+Config[id].meteoShowType[i]+"</span>";
			}
		}
	}
	//加载站点控制
	if(Config[id].stationShowType == null || (Config[id].stationShowType && Config[id].stationShowType.length <= 0)){
		$("#advancedQuery_stationShowType_"+id+"_div").hide();
	}else{
		for(var i=0; i<Config[id].stationShowType.length; i++){
			if(i % 2 == 0 && i != 0){
				html3 += "<br/>";
			}
			if((i + 1) % 2 == 0){
				html3 += "<span class=\"advancedQuery_type_span1\" name=\"advancedQuery_stationType_"+id+"\" param=\""+Config[id].stationParam[i]+"\" flag=\""+Config[id].initstationArray[i]+"\">"+Config[id].stationShowType[i]+"</span>";
			}else{
				html3 += "<span class=\"advancedQuery_type_span\" name=\"advancedQuery_stationType_"+id+"\" param=\""+Config[id].stationParam[i]+"\" flag=\""+Config[id].initstationArray[i]+"\">"+Config[id].stationShowType[i]+"</span>";
			}
		}
	}
	if(Config[id].operation){
		if(Config[id].operation[0] == 1){
			html5 += "<span id=\"advancedQuery_layerOperation_"+id+"_span1\" class=\"advancedQuery_type_span layerOperation_span\">查看数据</span>";
		}
		if(Config[id].operation[1] == 1){
			html5 += "<span id=\"advancedQuery_layerOperation_"+id+"_span2\" class=\"advancedQuery_type_span1 layerOperation_span\">查看图片产品</span>";
		}
		if(Config[id].operation[0] == 0 && Config[id].operation[1] == 0){
			$("#advancedQuery_layerOperation_"+id+"_div").hide();
		}
	}else{
		$("#advancedQuery_layerOperation_"+id+"_div").hide();
	}
	$("#advancedQuery_time_"+id+"").append(html1);
	//设置时间尺度选中效果
	$("#advancedQuery_time_"+id+">span:eq("+Config[id].initTimeType+")").css({"color":"#fff", "background-color":"#4187e7"});	
	$("#advancedQuery_time_"+id+">span:eq("+Config[id].initTimeType+")").attr("flag", "1");
	
	$("#advancedQuery_meteoShowType_"+id+"").append(html2);
	//设置要素控制选中效果	
	for(var i=0; i<Config[id].initmeteoShow.length; i++){
		$("#advancedQuery_meteoShowType_"+id+">span:eq("+Config[id].initmeteoShow[i]+")").css({"color":"#fff", "background-color":"#4187e7"});
	}
	$("#advancedQuery_meteoShowType_"+id+">span").attr("flag", "0");
	for(var i=0; i<Config[id].initmeteoShow.length; i++){
		$("#advancedQuery_meteoShowType_"+id+">span:eq("+Config[id].initmeteoShow[i]+")").attr("flag", "1");
	}
	
	$("#advancedQuery_stationShowType_"+id+"").append(html3);
	//设置站点控制选中效果
	$("#advancedQuery_stationShowType_"+id+">span[flag=1]").css({"color":"#fff", "background-color":"#4187e7"});
	
	$("#advancedQuery_layerOperation_"+id+"").append(html5);
	
	for(var i=0; i<Config[id].timeArray.length; i++){
		if(i == Config[id].initTimeType){
			$("#advancedQuery_type_"+id+"").append(
				"<div id=\"advancedQuery_type_div"+(i+1)+"_"+id+"\"></div>"
			);
		}else{
			$("#advancedQuery_type_"+id+"").append(
				"<div id=\"advancedQuery_type_div"+(i+1)+"_"+id+"\" style=\"display:none;\"></div>"
			);
		}
		$("#advancedQuery_type_div"+(i+1)+"_"+id+"").append(htmlArray[i]);
		//设置选中样式
		if( id !== "58" && id !== "233" && id !== "104"){
			$("#advancedQuery_type_div"+(i+1)+"_"+id+">span:eq("+Config[id].initTypeArray[i]+")").css({"color":"#fff", "background-color":"#4187e7"});
		}
		//设置选中状态
		$("#advancedQuery_type_div"+(i+1)+"_"+id+">span:eq("+Config[id].initTypeArray[i]+")").attr("flag", "1");
	}
	
	//要素控制判断图层是否有相应图层
	meteoShowTypeVisibility(id);
	
	//设置param1
	if(Config.layerType9.indexOf(","+id+",") >= 0){
		Global.common.param1 = Config[id].timeParam[Config[id].initTimeType] + "," + Config[id].typeParam[Config[id].initTimeType][Config[id].initTypeArray[Config[id].initTimeType]];
	} else if (Config.layerTypeYubao.indexOf(","+id+",") >= 0){
		Global.common.param1 = Config[id].timeParam[Config[id].initTimeType] + "," + Config[id].typeParam[Config[id].initTimeType][Config[id].initTypeArray[Config[id].initTimeType]];
	}
	
	//设置透明度
	$("#opacitySlider_"+id+"").slider({
		range: "min",
		max: 100,
		change: refreshSlider
	});
	//初始透明度显示
	$("#opacitySlider_"+id+"").slider("value", $("#tree_li_"+id).attr("opacity"));
	if(Config[id].opacity == null){
		$("#advancedQuery_opacitySlider_"+id+"_div").hide();
	}
	//设置高级查询面板上偏移量
	setAdvancedQueryDivTop($("#tree_li_"+id+"_img5"), $("#tree_li_"+id+"_advancedQueryDiv"));
	//点击事件
	$("#tree_li_"+id+"_advancedQueryDiv").on("click", {"id":id}, advancedQueryNClickFunc);
}

/**
 * @note 根据图层id加载高级查询面板3内容
 * @author 吴义迪
 * @create_time 2017-08-06
 */
function loadAdvancedQueryDiv3ContentById(id){
	//html拼写
	var html1 = "";
	var html2 = "";
	var html3 = "";
	var html5 = "";
	var htmlArray = [];
	//指标类型标题拼写
	$("#advancedQuery_type_b_"+id+"").html(Config[id].typeName);
	if(Config[id].timeArray.length <= 0){
		$("#advancedQuery_time_"+id+"_div").hide();
	}else{
		if(Config[id].timeArray.length == 1){
			$("#advancedQuery_time_"+id+"_div").hide();
		}
		for(var i=0; i<Config[id].timeArray.length; i++){
			if(i % 4 == 0 && i != 0){
				html1 += "<br/>";
			}
			if((i + 1) % 4 == 0){
				html1 += "<span class=\"advancedQuery_time_span1\" name=\"advancedQuery_time_span_"+id+"\" index=\""+(i+1)+"\" param=\""+Config[id].timeParam[i]+"\">"+Config[id].timeArray[i]+"</span>";
			}else{
				html1 += "<span class=\"advancedQuery_time_span\" name=\"advancedQuery_time_span_"+id+"\" index=\""+(i+1)+"\" param=\""+Config[id].timeParam[i]+"\">"+Config[id].timeArray[i]+"</span>";
			}
		}
	}
	if(Config[id].typeArray.length <= 0){
		$("#advancedQuery_type_"+id+"_div").hide();
	}else{	
		for(var i=0; i<Config[id].typeArray.length; i++){
			var typeHtml = "";
			for(var j=0; j<Config[id].typeArray[i].length; j++){
					if(j % 2 == 0 && j != 0){
						typeHtml += "<br/>";
					}
					// if( Config.layerTypeN.indexOf(","+id+",") >= 0){
	
					// }
					if((j + 1) % 2 == 0){					
						typeHtml += "<span class=\"advancedQuery_type_span1\" name=\"advancedQuery_type_span_"+id+"\" index=\""+j+"\" param=\""+Config[id].typeParam[i][j]+"\" title=\""+Config[id].typeArray[i][j]+"\">"+Config[id].typeArray[i][j]+"</span>";
					}else{
						typeHtml += "<span class=\"advancedQuery_type_span\" name=\"advancedQuery_type_span_"+id+"\" index=\""+j+"\" param=\""+Config[id].typeParam[i][j]+"\" title=\""+Config[id].typeArray[i][j]+"\">"+Config[id].typeArray[i][j]+"</span>";
					}
			}			
			htmlArray.push(typeHtml);
		}
	}
	//加载要素控制
	if(Config[id].meteoShowType == null || (Config[id].meteoShowType && Config[id].meteoShowType.length <= 0)){
		$("#advancedQuery_meteoShowType_"+id+"_div").hide();
	}else{
		for(var i=0; i<Config[id].meteoShowType.length; i++){
			if(i % 2 == 0 && i != 0){
				html2 += "<br/>";
			}
			if((i + 1) % 2 == 0){
				html2 += "<span class=\"advancedQuery_type_span1\" name=\"advancedQuery_showType_"+id+"\" param=\""+Config[id].meteoParam[i]+"\">"+Config[id].meteoShowType[i]+"</span>";
			}else{
				html2 += "<span class=\"advancedQuery_type_span\" name=\"advancedQuery_showType_"+id+"\" param=\""+Config[id].meteoParam[i]+"\">"+Config[id].meteoShowType[i]+"</span>";
			}
		}
	}
	//加载站点控制
	if(Config[id].stationShowType == null || (Config[id].stationShowType && Config[id].stationShowType.length <= 0)){
		$("#advancedQuery_stationShowType_"+id+"_div").hide();
	}else{
		for(var i=0; i<Config[id].stationShowType.length; i++){
			if(i % 2 == 0 && i != 0){
				html3 += "<br/>";
			}
			if((i + 1) % 2 == 0){
				html3 += "<span class=\"advancedQuery_type_span1\" name=\"advancedQuery_stationType_"+id+"\" param=\""+Config[id].stationParam[i]+"\" flag=\""+Config[id].initstationArray[i]+"\">"+Config[id].stationShowType[i]+"</span>";
			}else{
				html3 += "<span class=\"advancedQuery_type_span\" name=\"advancedQuery_stationType_"+id+"\" param=\""+Config[id].stationParam[i]+"\" flag=\""+Config[id].initstationArray[i]+"\">"+Config[id].stationShowType[i]+"</span>";
			}
		}
	}
	if(Config[id].operation){
		if(Config[id].operation[0] == 1){
			html5 += "<span id=\"advancedQuery_layerOperation_"+id+"_span1\" class=\"advancedQuery_type_span layerOperation_span\">查看数据</span>";
		}
		if(Config[id].operation[1] == 1){
			html5 += "<span id=\"advancedQuery_layerOperation_"+id+"_span2\" class=\"advancedQuery_type_span1 layerOperation_span\">查看图片产品</span>";
		}
		if(Config[id].operation[0] == 0 && Config[id].operation[1] == 0){
			$("#advancedQuery_layerOperation_"+id+"_div").hide();
		}
	}else{
		$("#advancedQuery_layerOperation_"+id+"_div").hide();
	}
	$("#advancedQuery_time_"+id+"").append(html1);
	//设置时间尺度选中效果
	$("#advancedQuery_time_"+id+">span:eq("+Config[id].initTimeType+")").css({"color":"#fff", "background-color":"#4187e7"});	
	$("#advancedQuery_time_"+id+">span:eq("+Config[id].initTimeType+")").attr("flag", "1");
	
	$("#advancedQuery_meteoShowType_"+id+"").append(html2);
	//设置要素控制选中效果	
	for(var i=0; i<Config[id].initmeteoShow.length; i++){
		$("#advancedQuery_meteoShowType_"+id+">span:eq("+Config[id].initmeteoShow[i]+")").css({"color":"#fff", "background-color":"#4187e7"});
	}
	$("#advancedQuery_meteoShowType_"+id+">span").attr("flag", "0");
	for(var i=0; i<Config[id].initmeteoShow.length; i++){
		$("#advancedQuery_meteoShowType_"+id+">span:eq("+Config[id].initmeteoShow[i]+")").attr("flag", "1");
	}
	
	$("#advancedQuery_stationShowType_"+id+"").append(html3);
	//设置站点控制选中效果
	$("#advancedQuery_stationShowType_"+id+">span[flag=1]").css({"color":"#fff", "background-color":"#4187e7"});
	
	$("#advancedQuery_layerOperation_"+id+"").append(html5);
	
	for(var i=0; i<Config[id].timeArray.length; i++){
		if(i == Config[id].initTimeType){
			$("#advancedQuery_type_"+id+"").append(
				"<div id=\"advancedQuery_type_div"+(i+1)+"_"+id+"\"></div>"
			);
		}else{
			$("#advancedQuery_type_"+id+"").append(
				"<div id=\"advancedQuery_type_div"+(i+1)+"_"+id+"\" style=\"display:none;\"></div>"
			);
		}
		$("#advancedQuery_type_div"+(i+1)+"_"+id+"").append(htmlArray[i]);
		//设置选中样式
		$("#advancedQuery_type_div"+(i+1)+"_"+id+">span:eq("+Config[id].initTypeArray[i]+")").css({"color":"#fff", "background-color":"#4187e7"});
		//设置选中状态
		$("#advancedQuery_type_div"+(i+1)+"_"+id+">span:eq("+Config[id].initTypeArray[i]+")").attr("flag", "1");
	}
	
	//要素控制判断图层是否有相应图层
	meteoShowTypeVisibility(id);
	
	//设置param1
	if(Config.layerType9.indexOf(","+id+",") >= 0){
		Global.common.param1 = Config[id].timeParam[Config[id].initTimeType] + "," + Config[id].typeParam[Config[id].initTimeType][Config[id].initTypeArray[Config[id].initTimeType]];
	} else if (Config.layerTypeYubao.indexOf(","+id+",") >= 0){
		Global.common.param1 = Config[id].timeParam[Config[id].initTimeType] + "," + Config[id].typeParam[Config[id].initTimeType][Config[id].initTypeArray[Config[id].initTimeType]];
	} else if ( id == 261){
		Global.common.param1 = Config[id].timeParam[Config[id].initTimeType] + "," + Config[id].typeParam[Config[id].initTimeType][Config[id].initTypeArray[Config[id].initTimeType]];
	}
	
	//设置透明度
	$("#opacitySlider_"+id+"").slider({
		range: "min",
		max: 100,
		change: refreshSlider
	});
	//初始透明度显示
	$("#opacitySlider_"+id+"").slider("value", $("#tree_li_"+id).attr("opacity"));
	if(Config[id].opacity == null){
		$("#advancedQuery_opacitySlider_"+id+"_div").hide();
	}
	//设置高级查询面板上偏移量
	setAdvancedQueryDivTop($("#tree_li_"+id+"_img5"), $("#tree_li_"+id+"_advancedQueryDiv"));
	//点击事件
	$("#tree_li_"+id+"_advancedQueryDiv").on("click", {"id":id}, advancedQuery3ClickFunc);
}

/**
 * @note 要素控制判断图层是否有相应图层
 * @param id：图层id
 * @author 吴义迪
 * @create_time 2017-08-06
 */
function meteoShowTypeVisibility(id){
	if(Config[id].meteoShowTypeFlag && Config[id].meteoShowTypeFlag.length> 0){
		var meteoShow = Config[id].meteoShowTypeFlag[parseInt($("#advancedQuery_time_"+id+">span[flag=1]").attr("index"))-1][parseInt($("#advancedQuery_type_div"+$("#advancedQuery_time_"+id+">span[flag=1]").attr("index")+"_"+id+">span[flag=1]").attr("index"))];
		if(meteoShow){
			var meteoShowArray = meteoShow.split(",");
			//离散点
			if(meteoShowArray[0] && meteoShowArray[0] == 1){
				$("#advancedQuery_meteoShowType_"+id+">span:eq(0)").show();
				$("#advancedQuery_layerOperation_"+id+"_span1").show();
			}else{
				$("#advancedQuery_meteoShowType_"+id+">span:eq(0)").hide();
				$("#advancedQuery_layerOperation_"+id+"_span1").hide();
				$("#advancedQuery_meteoShowType_"+id+">span:eq(0)").attr("flag", "0");
				$("#advancedQuery_meteoShowType_"+id+">span:eq(0)").css({"color":"", "background-color":""});
			}
			//标签图
			if(meteoShowArray[1] && meteoShowArray[1] == 1){
				$("#advancedQuery_meteoShowType_"+id+">span:eq(1)").show();
			}else{
				$("#advancedQuery_meteoShowType_"+id+">span:eq(1)").hide();
				$("#advancedQuery_meteoShowType_"+id+">span:eq(1)").attr("flag", "0");
				$("#advancedQuery_meteoShowType_"+id+">span:eq(1)").css({"color":"", "background-color":""});
			}
			//色斑图
			if(meteoShowArray[2] && meteoShowArray[2] == 1){
				$("#advancedQuery_meteoShowType_"+id+">span:eq(2)").show();
				$("#advancedQuery_layerOperation_"+id+"_span2").show();
			}else{
				$("#advancedQuery_meteoShowType_"+id+">span:eq(2)").hide();
				$("#advancedQuery_layerOperation_"+id+"_span2").hide();
				$("#advancedQuery_meteoShowType_"+id+">span:eq(2)").attr("flag", "0");
				$("#advancedQuery_meteoShowType_"+id+">span:eq(2)").css({"color":"", "background-color":""});
			}
		}
	}
}

/**
 * @note 加载高级查询面板4
 * @author 吴义迪
 * @create_time 2017-08-12
 */
function loadAdvancedQueryDiv4(id){
	var name = $("#tree_li_"+id+"").attr("layername");
	var parentNodeName = $("#tree_li_"+($("#tree_li_"+id+"").attr("fid"))+"").attr("layername");
	$(".menu1_div").hide();
	if($("#tree_li_"+id+"_advancedQueryDiv").length > 0){
		$("#tree_li_"+id+"_advancedQueryDiv").show();
	}else{
		var left = 331;
		var html = "";
		html =  "<div id=\"tree_li_"+id+"_advancedQueryDiv\" class=\"menu1_div\" " +
				"     style=\"position:absolute; left:"+left+"px; background:#fff; padding:10px; " +
				"	          border-radius:4px; z-index:10; display:none;\">" +
				"	<div id=\"advancedQuery_header_"+id+"_div\">" +
				"		<div><span><b>"+parentNodeName+" - "+name+"</b><span></div>" +
				"		<hr style=\"margin: 6px 0; border-top:1px solid #ccc;\"/>" +
				"	</div>" +
				"	<div id=\"advancedQuery_type_"+id+"_div\">" +
				"		<div><span><b id=\"advancedQuery_type_b_"+id+"\">要素类型</b></span></div>" +
				"		<div id=\"advancedQuery_type_"+id+"\" class=\"advancedQuery_div1\"></div>" +
				"	</div>" +
				"	<div id=\"advancedQuery_meteoShowType_"+id+"_div\">" +
				"		<div><span><b>图层控制</b></span></div>" +
				"		<div id=\"advancedQuery_meteoShowType_"+id+"\" class=\"advancedQuery_div1\"></div>" +
				"	</div>" +
				"	<span id=\"menu1_div_"+id+"_exit\" class=\"menu1_div_exit\">×</span>" +
				"</div>";
		$("body").append(html);
		//根据图层id加载高级查询面板4内容
		loadAdvancedQueryDiv4ContentById(id);
	}
}

/**
 * @note 根据图层id加载高级查询面板4内容
 * @param id：图层id
 * @author 吴义迪
 * @create_time 2017-08-12
 */
function loadAdvancedQueryDiv4ContentById(id){
	var typeHtml = "";
	var meteoShowHtml = "";
	for(var j=0; j<Config[id].typeArray.length; j++){
		if(j % 2 == 0 && j != 0){
			typeHtml += "<br/>";
		}
		if((j + 1) % 2 == 0){
			typeHtml += "<span class=\"advancedQuery_type_span1\" name=\"advancedQuery_type_span_"+id+"\" index=\""+j+"\" param=\""+Config[id].typeParam[j]+"\" title=\""+Config[id].typeArray[j]+"\">"+Config[id].typeArray[j]+"</span>";
		}else{
			typeHtml += "<span class=\"advancedQuery_type_span\" name=\"advancedQuery_type_span_"+id+"\" index=\""+j+"\" param=\""+Config[id].typeParam[j]+"\" title=\""+Config[id].typeArray[j]+"\">"+Config[id].typeArray[j]+"</span>";
		}
	}
	for(var j=0; j<Config[id].meteoShowArray.length; j++){
		if(j % 2 == 0 && j != 0){
			meteoShowHtml += "<br/>";
		}
		if((j + 1) % 2 == 0){
			meteoShowHtml += "<span class=\"advancedQuery_type_span1\" name=\"advancedQuery_meteoShow_span_"+id+"\" index=\""+j+"\" param=\""+Config[id].meteoParam[j]+"\" title=\""+Config[id].meteoShowArray[j]+"\">"+Config[id].meteoShowArray[j]+"</span>";
		}else{
			meteoShowHtml += "<span class=\"advancedQuery_type_span\" name=\"advancedQuery_meteoShow_span_"+id+"\" index=\""+j+"\" param=\""+Config[id].meteoParam[j]+"\" title=\""+Config[id].meteoShowArray[j]+"\">"+Config[id].meteoShowArray[j]+"</span>";
		}
	}
	$("#advancedQuery_type_"+id+"").html(typeHtml);
	$("#advancedQuery_type_"+id+">span:eq("+Config[id].initType+")").css({"color":"#fff", "background-color":"#4187e7"});
	$("#advancedQuery_type_"+id+">span:eq("+Config[id].initType+")").attr("flag", "1");
	
	$("#advancedQuery_meteoShowType_"+id+"").html(meteoShowHtml);
	for(var i=0; i<Config[id].initmeteoShow.length; i++){
		if(Config[id].initmeteoShow[i] == 1){
			$("#advancedQuery_meteoShowType_"+id+">span:eq("+i+")").css({"color":"#fff", "background-color":"#4187e7"});
			$("#advancedQuery_meteoShowType_"+id+">span:eq("+i+")").attr("flag", "1");
		}else{
			$("#advancedQuery_meteoShowType_"+id+">span:eq("+i+")").css({"color":"", "background-color":""});
			$("#advancedQuery_meteoShowType_"+id+">span:eq("+i+")").attr("flag", "0");
		}
		
	}
	
	//设置高级查询面板上偏移量
	setAdvancedQueryDivTop($("#tree_li_"+id+"_img5"), $("#tree_li_"+id+"_advancedQueryDiv"));
	//点击事件
	$("#tree_li_"+id+"_advancedQueryDiv").on("click", {"id":id}, advancedQuery4ClickFunc);
}

/**
 * @note 加载高级查询面板5
 * @author 吴义迪
 * @create_time 2017-10-13
 */
function loadAdvancedQueryDiv5(id){
	$(".menu1_div").hide();
	if($("#tree_li_"+id+"_advancedQueryDiv").length > 0){
		$("#tree_li_"+id+"_advancedQueryDiv").show();
	}else{
		var left = 331;
		var html = "";
		html =  "<div id=\"tree_li_"+id+"_advancedQueryDiv\" class=\"menu1_div\" " +
				"     style=\"position:absolute; left:"+left+"px; background:#fff; padding:10px 1px 10px 10px;" +
				"	          border-radius:4px; z-index:10; display:none;max-height:650px;\">" +
				"	<div>" +
				"	<ul id=\"yjxh_nav_ul\" class=\"nav nav-tabs\" style=\"background:rgba(255, 255, 255, 0.6);border-bottom:1px solid #ddd;margin-bottom:8px;margin-right:10px;\" role=\"tablist\">" +
				"		<li role=\"presentation\" class=\"active\" style=\"font-size:15px;width:auto;\">" +
				"			<a id=\"yjxh_dqsx_a\" href=\"#yjxh_dqsx\" aria-controls=\"yjxh_dqsx\" role=\"tab\" data-toggle=\"tab\" style=\"padding:2px 5px;border-radius:4px 4px 0 0;\">当前生效</a>" +
				"		</li>" +
				"		<li role=\"presentation\" style=\"font-size:15px;width:auto;\">" +
				"			<a id=\"yjxh_tjcx_a\" href=\"#yjxh_tjcx\" aria-controls=\"yjxh_tjcx\" role=\"tab\" data-toggle=\"tab\" style=\"padding:2px 5px;border-radius:4px 4px 0 0;\">条件查询</a>" +
				"		</li>" +
				"	</ul>" +
				"	<div class=\"tab-content\">" +
				"		<div role=\"tabpanel\" class=\"tab-pane active\" id=\"yjxh_dqsx\" style=\"padding-right:10px;\">" +
				"			<div id=\"yjxh_dqsx_div1\"></div>" +
				"			<div id=\"yjxh_dqsx_div2\" style=\"margin-top:8px;font-size:13px;\">" +
				"				<span>发布区域</span>" +
				"				<select id=\"yjxh_dqsx_select\" style=\"width:169px;height:23px;\"></select>" +
				"			</div>" +
				"		</div>" +
				"		<div role=\"tabpanel\" class=\"tab-pane\" id=\"yjxh_tjcx\">" +
				"			<div id=\"yjxh_tjcx_div\"><div id=\"yjxh_tjcx_div1\"></div></div>" +
				"			<div style=\"margin-top:8px;\">" +
				"				<span>时间选择</span>" +
				"				<input id=\"yjxh_startime\" placeholder=\"开始时间\" style=\"padding-left:5px;width:118px;cursor:pointer;\" readonly/>" +
				"				<input id=\"yjxh_endtime\" placeholder=\"结束时间\" style=\"padding-left:5px;width:118px;cursor:pointer;\" readonly/>" +
				"			</div>" +
				"			<div style=\"margin-top:8px;\">" +
				"				<span>区域选择</span>" +
				"				<select id=\"Province\" name=\"Province\" style=\"display:none;width:130px;height:23px;\"></select>" +
				"				<select id=\"City\" name=\"City\" style=\"width:118px;height:23px;\"></select>" +
				"				<select id=\"Area\" name=\"Area\" style=\"width:118px;height:23px;\"></select>" +
				"			</div>" +
				"			<div style=\"text-align:right;margin-top:8px;margin-right:10px;\">" +
				"				<a id=\"yjxh_query\" class=\"btn btn-info yjxh_button\">查询</a>" +
				"			</div>" +
				"		</div>" +
				"	</div>" +
				"	</div>" +
				"	<span id=\"menu1_div_"+id+"_exit\" class=\"menu1_div_exit\">×</span>" +
				"</div>";
		$("body").append(html);
		var date = new Date();
		$("#yjxh_endtime").val(date.getFullYear() + "-" + (date.getMonth()+1<10?"0"+(date.getMonth()+1):date.getMonth()+1) + "-" + (date.getDate()<10?"0"+date.getDate():date.getDate()));
		date.setDate(date.getDate()-3);
		$("#yjxh_startime").val(date.getFullYear() + "-" + (date.getMonth()+1<10?"0"+(date.getMonth()+1):date.getMonth()+1) + "-" + (date.getDate()<10?"0"+date.getDate():date.getDate()));
		new PCAS("Province","City","Area","150000");
		new addScroll('yjxh_tjcx_div','yjxh_tjcx_div1','scrollDiv');
		//点击事件
		$("#tree_li_"+id+"_advancedQueryDiv").on("click", {"id":id}, advancedQuery5ClickFunc);
		laydate.render({
			elem: '#yjxh_startime',
			trigger: 'click',
			type: 'date',
			theme: '#4187e7',
			format: "yyyy-MM-dd"
		});
		laydate.render({
			elem: '#yjxh_endtime',
			trigger: 'click',
			type: 'date',
			theme: '#4187e7',
			format: "yyyy-MM-dd"
		});
		//区域切换监听
		$("#yjxh_dqsx_select").on("change", yjxhAreaChangeFunc);
	}
}

/**
 * @note 加载高级查询面板6
 * @author 吴义迪
 * @create_time 2018-01-16
 */
function loadAdvancedQueryDiv6(id){
	var name = $("#tree_li_"+id+"").attr("layername");
	var parentNodeName = $("#tree_li_"+($("#tree_li_"+id+"").attr("fid"))+"").attr("layername");
	$(".menu1_div").hide();
	if($("#tree_li_"+id+"_advancedQueryDiv").length > 0){
		$("#tree_li_"+id+"_advancedQueryDiv").show();
	}else{
		var left = 331;
		var html = "";
		html =  "<div id=\"tree_li_"+id+"_advancedQueryDiv\" class=\"menu1_div\" " +
				"     style=\"position:absolute; left:"+left+"px; background:#fff; padding:10px; " +
				"	          border-radius:4px; z-index:10; display:none;\">" +
				"	<div id=\"advancedQuery_header_"+id+"_div\">" +
				"		<div><span><b>"+parentNodeName+" - "+name+"</b><span></div>" +
				"		<hr style=\"margin: 6px 0; border-top:1px solid #ccc;\"/>" +
				"	</div>" +
				"	<div id=\"advancedQuery_type_"+id+"_div\">" +
				"		<div><span><b id=\"advancedQuery_type_b_"+id+"\">指标类型</b></span></div>" +
				"		<div id=\"advancedQuery_type_"+id+"\" style=\"padding-bottom:5px;\" class=\"advancedQuery_div1\"></div>" +
				"	</div>" +
				"	<div id=\"advancedQuery_stationShowType_"+id+"_div\">" +
				"		<div><span><b>站点控制</b></span></div>" +
				"		<div id=\"advancedQuery_stationShowType_"+id+"\" class=\"advancedQuery_div1\"></div>" +
				"	</div>" +
				"	<span id=\"menu1_div_"+id+"_exit\" class=\"menu1_div_exit\">×</span>" +
				"</div>";
		$("body").append(html);
		//根据图层id加载高级查询面板6内容
		loadAdvancedQueryDiv6ContentById(id);
	}
}

/**
 * @note 根据图层id加载高级查询面板6内容
 * @param id：图层id
 * @author 吴义迪
 * @create_time 2018-01-16
 */
function loadAdvancedQueryDiv6ContentById(id){
	var html1 = "<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" flag=\"-1\"></span>" + 
				"<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" value=\"TEM_ChANGE_24h,-20,40,#000000,r\" flag=\"0\" title=\"24小时变温\">T24</span>" +
				"<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" value=\"\" flag=\"-1\" title=\"高云状\">CH</span>" +
				"<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" value=\"PRS_Change_24h,20,40,l\" flag=\"0\" title=\"24小时变压\">P24</span>" +
				"<span class=\"advancedQuery_type_span2\" name=\"advancedQuery_type_span_"+id+"\" flag=\"-1\"></span>" +
				"<br>" +
				"<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" value=\"\" flag=\"-1\"></span>" +
				"<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" value=\"TEM,-20,20,#FF0000,r\" flag=\"1\" title=\"温度\">T</span>" +
				"<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" value=\"\" flag=\"-1\" title=\"中云状\">CM</span>" +
				"<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" value=\"PRS_Sea,20,20,#0000FF,l\" flag=\"1\" title=\"海平面气压\">P</span>" +
				"<br>" +
				"<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" value=\"\" flag=\"-1\"></span>" +
				"<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" value=\"WEP_Now,-30,-8,#000000,r\" flag=\"1\" title=\"现在天气\">ww</span>" +
				"<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" value=\"WIN_S_Avg_2mi,-8,-26,#000000,l;CLO_Cov,0,0,#000000\" flag=\"1\" title=\"总云量和2分钟平均风速\">N</span>" +
				"<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" value=\"PRS_Change_3h,20,0,#000000,l\" flag=\"1\" title=\"3小时变压\">P3</span>" +
				"<br>" +
				"<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" value=\"\" flag=\"-1\"></span>" +
				"<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" value=\"VIS,-20,-20,#000000,r\" flag=\"0\" title=\"水平能见度（人工）\">vv</span>" +
				"<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" value=\"\" flag=\"-1\" title=\"低云状\">CL</span>" +
				"<span class=\"advancedQuery_type_span3\" id=\"advancedQuery_type_span_w1_"+id+"\" value=\"WEP_Past_1,30,8,#000000,l\" flag=\"0\" title=\"过去天气1\">1</span>" +
				"<span class=\"advancedQuery_type_span3 span_margin\" id=\"advancedQuery_type_span_w2_"+id+"\" value=\"WEP_Past_2,30,8,#000000,l\" flag=\"0\" title=\"过去天气2\">2</span>" +
				"<br>" +
				"<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" value=\"\" flag=\"-1\"></span>" + 
				"<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" value=\"DPT,-20,-40,#689C63,r\" flag=\"1\" title=\"露点温度\">Td</span>" +
				"<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" value=\"CLO_Height_LoM,0,-40,#000000,l\" flag=\"0\" title=\"低云高\">h</span>" +
				"<span class=\"advancedQuery_type_span2 span_margin\" name=\"advancedQuery_type_span_"+id+"\" value=\"CLO_Cov_Low,20,-40,#000000,l\" flag=\"0\" title=\"低云量\">Nh</span>" +
				"<span class=\"advancedQuery_type_span2\" name=\"advancedQuery_type_span_"+id+"\" value=\"PRE_6h,40,-40,#008000,l\" flag=\"1\" title=\"6小时降水\">R6</span>" +
				"<br>" +
				"<span class=\"advancedQuery_type_span4\" name=\"advancedQuery_type_span_"+id+"\" value=\"Station_Id_C,40,-60,#000000,r\" flag=\"0\" title=\"站号\">站号</span>" +
				"<span class=\"advancedQuery_type_span5\" name=\"advancedQuery_type_span_"+id+"\" value=\"\" flag=\"-1\" title=\"\">Sp</span>";
	var html3 = "";
	//加载指标类型\
	$("#advancedQuery_type_"+id+"").html(html1);
	$("#advancedQuery_type_"+id+">span[flag='1']").css({"background":"#4187e7", "color":"#fff"});
	$("#advancedQuery_type_"+id+">span[flag='0']").css({"background":"#CD5C5C", "color":"#fff"});
	$("#advancedQuery_type_"+id+">span[flag='-1']").css({"background":"#A0A0A0", "cursor":"default"});
	
	//加载站点控制
	if(Config[id].stationShowType == null || (Config[id].stationShowType && Config[id].stationShowType.length <= 0)){
		$("#advancedQuery_stationShowType_"+id+"_div").hide();
	}else{
		for(var i=0; i<Config[id].stationShowType.length; i++){
			if(i % 2 == 0 && i != 0){
				html3 += "<br/>";
			}
			if((i + 1) % 2 == 0){
				html3 += "<span class=\"advancedQuery_type_span1\" name=\"advancedQuery_stationType_"+id+"\" param=\""+Config[id].stationParam[i]+"\" flag=\""+Config[id].initstationArray[i]+"\">"+Config[id].stationShowType[i]+"</span>";
			}else{
				html3 += "<span class=\"advancedQuery_type_span\" name=\"advancedQuery_stationType_"+id+"\" param=\""+Config[id].stationParam[i]+"\" flag=\""+Config[id].initstationArray[i]+"\">"+Config[id].stationShowType[i]+"</span>";
			}
		}
		$("#advancedQuery_stationShowType_"+id+"").html(html3);
	}
	//设置站点控制选中效果
	$("#advancedQuery_stationShowType_"+id+">span[flag=1]").css({"color":"#fff", "background-color":"#4187e7"});
	
	//设置高级查询面板上偏移量
	setAdvancedQueryDivTop($("#tree_li_"+id+"_img5"), $("#tree_li_"+id+"_advancedQueryDiv"));
	//点击事件
	$("#tree_li_"+id+"_advancedQueryDiv").on("click", {"id":id}, advancedQuery6ClickFunc);
}

/**
 * @note 高级查询面板2点击监听事件
 * @author 吴义迪
 * @create_time 2017-07-06
 */
function advancedQuery2ClickFunc(e){
	e = e || window.event;	var id = e.data.id;
	
	//退出
	if(e.target.id == "menu1_div_"+id+"_exit"){
		$("#tree_li_"+id+"_advancedQueryDiv").hide();
	}
}

/**
 * @note 高级查询面板3点击监听事件
 * @author 吴义迪
 * @create_time 2017-08-06
 */
function advancedQueryNClickFunc(e){
	e = e || window.event;
	var id = e.data.id;	
	//退出
	if(e.target.id == "menu1_div_"+id+"_exit"){
		$("#tree_li_"+id+"_advancedQueryDiv").hide();
	}
	//时间尺度
	else if(e.target.attributes.name && e.target.attributes.name.nodeValue == "advancedQuery_time_span_"+id+""){
		//设置选中样式
		$("#advancedQuery_time_"+id+">span").css({"color":"", "background-color":""});
		e.target.style.color = "#fff";
		e.target.style.backgroundColor = "#4187e7";
		//设置选中状态
		$("#advancedQuery_time_"+id+">span").attr("flag", "0");
		e.target.attributes.flag.nodeValue = "1";
		//设置指标类型切换
		$("#advancedQuery_type_"+id+">div").hide();
		$("#advancedQuery_type_div"+e.target.attributes.index.nodeValue+"_"+id+"").show();
		
		//参数设置
		Global.common.param1 = $("#advancedQuery_time_"+id+">span[flag='1']").attr("param") + "," + $("#advancedQuery_type_div"+e.target.attributes.index.nodeValue+"_"+id+">span[flag='1']").attr("param");
		
		//要素控制判断图层是否有相应图层
		meteoShowTypeVisibility(id);
		
		//设置高级查询面板上偏移量
		setAdvancedQueryDivTop($("#tree_li_"+id+"_img5"), $("#tree_li_"+id+"_advancedQueryDiv"));
		
		closePopup();

		//加载图层
		Config[id].initTimeAxisFlag = true;
		// loadLayer(id);
		// requestZPointLayer(id);
		if( Config.layerTypeN.indexOf(","+id+",") >= 0 ){
			var mycars=[ ];
			mycars = Config.layerTypeT;
			mycars += Config.layerTypeZ;
			mycars = mycars.split(",");
			for ( j = 0; j < mycars.length; j++ ) {
				if ( Global.common.map.getLayersByName("layer_"+ mycars[j])[0] ) {
					Global.common.map.removeLayer( Global.common.map.getLayersByName("layer_"+ mycars[j])[0] );
					removePoiLegend(mycars[j]);
					break;
				}
			}
			if( id == "58" ){
				requestNPointLayer(Global.common.param1.split(",")[1]);
			} else if( id == "233" ){
				requestZPointLayer(Global.common.param1.split(",")[1]);
			} 
		}
	}
	//指标类型
	else if(e.target.attributes.name && e.target.attributes.name.nodeValue == "advancedQuery_type_span_"+id+""){
		var parentNodeId = e.target.parentNode.id;
		
		//设置选中样式
		$("#"+parentNodeId+">span").css({"color":"", "background-color":""});
		e.target.style.color = "#fff";
		e.target.style.backgroundColor = "#4187e7";
		//设置选中状态
		$("#"+parentNodeId+">span").attr("flag", "0");
		e.target.attributes.flag.nodeValue = "1";
		
		//参数设置
		Global.common.param1 = $("#advancedQuery_time_"+id+">span[flag='1']").attr("param") + "," + $("#"+parentNodeId+">span[flag='1']").attr("param");
		
		//要素控制判断图层是否有相应图层
		meteoShowTypeVisibility(id);
		
		//设置高级查询面板上偏移量
		setAdvancedQueryDivTop($("#tree_li_"+id+"_img5"), $("#tree_li_"+id+"_advancedQueryDiv"));
		
		closePopup();

		//加载图层
		if( Config.layerTypeN.indexOf(","+id+",") >= 0 ){
			var mycars=[ ];
			mycars = Config.layerTypeT;
			mycars += Config.layerTypeZ;
			mycars += Config.layerTypeFarm
			mycars = mycars.split(",");
			for ( j = 0; j < mycars.length; j++ ) {
				if ( Global.common.map.getLayersByName("layer_"+ mycars[j])[0] ) {
					Global.common.map.removeLayer( Global.common.map.getLayersByName("layer_"+ mycars[j])[0] );
					removePoiLegend(mycars[j]);
					break;
				}
			}
			if( id == "58" ){
				requestNPointLayer(Global.common.param1.split(",")[1]);
			} else if( id == "233" ){
				requestZPointLayer(Global.common.param1.split(",")[1]);
			} else if( id == "104" ){
				requestFarmPointLayer(Global.common.param1.split(",")[1]);
			}
		} else{
			loadLayer(id);
		}
		
	}
	//离散点色斑图控制
	else if(e.target.attributes.name && e.target.attributes.name.nodeValue == "advancedQuery_showType_"+id+""){
		if(e.target.attributes.flag.nodeValue == "1"){
			//清除选中样式
			e.target.style.color = "";
			e.target.style.backgroundColor = "";
			//清除选中状态
			e.target.attributes.flag.nodeValue = "0";
			//清除图层
			if(e.target.attributes.param.nodeValue == "point"){
				var layers = Global.common.map.getLayersByName(Config.layerType9Name[0]);
				if(layers.length > 0){
					if($("#advancedQuery_meteoShowType_"+id+">span[param='label']").attr("flag") == "1"){
						for(var i=0; i<layers[0].features.length; i++){
							layers[0].features[i].style.pointRadius = "0";
						}
						layers[0].redraw();
					}else{
						layers[0].removeAllFeatures();
					}
				}
			}else if(e.target.attributes.param.nodeValue == "label"){
				var layers = Global.common.map.getLayersByName(Config.layerType9Name[0]);
				if(layers.length > 0){
					if($("#advancedQuery_meteoShowType_"+id+">span[param='point']").attr("flag") == "1"){
						for(var i=0; i<layers[0].features.length; i++){
							layers[0].features[i].style.fontOpacity = "0";
						}
						layers[0].redraw();
					}else{
						layers[0].removeAllFeatures();
					}
				}
			}else if(e.target.attributes.param.nodeValue == "isoGeo"){
				var layers = Global.common.map.getLayersByName(Config.layerType9Name[1]);
				if(layers.length > 0){
					layers[0].removeAllFeatures();
				}
			}
		}else{
			//设置选中样式
			e.target.style.color = "#fff";
			e.target.style.backgroundColor = "#4187e7";
			//设置选中状态
			e.target.attributes.flag.nodeValue = "1";
			//加载图层
			if(e.target.attributes.param.nodeValue == "point"){
				var layers = Global.common.map.getLayersByName(Config.layerType9Name[0]);
				if($("#advancedQuery_meteoShowType_"+id+">span[param='label']").attr("flag") == "1"){
					for(var i=0; i<layers[0].features.length; i++){
						layers[0].features[i].style.pointRadius = "5";
					}
					layers[0].redraw();
				}else{
					loadLayer(id);
				}
			}else if(e.target.attributes.param.nodeValue == "label"){
				var layers = Global.common.map.getLayersByName(Config.layerType9Name[0]);
				if($("#advancedQuery_meteoShowType_"+id+">span[param='point']").attr("flag") == "1"){
					for(var i=0; i<layers[0].features.length; i++){
						layers[0].features[i].style.fontOpacity = "1";
					}
					layers[0].redraw();
				}else{
					loadLayer(id);
				}
			}else{
				loadLayer(id);
			}
		}
	}
	//站点控制
	else if(e.target.attributes.name && e.target.attributes.name.nodeValue == "advancedQuery_stationType_"+id+""){
		if(e.target.attributes.flag.nodeValue == "1"){
			//清除选中样式
			e.target.style.color = "";
			e.target.style.backgroundColor = "";
			//清除选中状态
			e.target.attributes.flag.nodeValue = "0";
		}else{
			//设置选中样式
			e.target.style.color = "#fff";
			e.target.style.backgroundColor = "#4187e7";
			//设置选中状态
			e.target.attributes.flag.nodeValue = "1";
		}
		var layers = Global.common.map.getLayersByName(Config.layerType9Name[0]);;
		if(layers != null && layers.length > 0){
			var stationTypeArray = $("#advancedQuery_stationShowType_"+id+">span[flag=1]");
			var stationParam = [];
			for(var i=0; i<stationTypeArray.length; i++){
				stationParam.push(stationTypeArray[i].attributes.param.nodeValue);
			}
			for(var i=0; i<layers[0].features.length; i++){
				var stationDiaplay = "";
				if(stationParam.length > 0){
					for(var j=0; j<stationParam.length; j++){
						if(layers[0].features[i].info.stationType == stationParam[j]){
			    			break;
			    		}
						if(j == stationParam.length - 1){
			    			stationDiaplay = "none";
			    		}
					}
				}else{
					stationDiaplay = "none";
				}
				layers[0].features[i].style.display = stationDiaplay;
			}
			layers[0].redraw();
		}
		if($("#map_table").is(":visible")){
			showTxtProductIntoTable();
		}
	}
	//图层操作-查看数据
	else if(e.target.id == "advancedQuery_layerOperation_"+id+"_span1"){
		if($("#map_table").is(":visible")){
			$("#map_table").hide();
		}else{
			if(Global.common.micaps3Data == null){
				showPromptMessage("当前图层无数据");
			}else{
				showTxtProductIntoTable();
			}
		}
	}
	//图层操作-查看图片产品
	else if(e.target.id == "advancedQuery_layerOperation_"+id+"_span2"){
		showImgProduct(id);
	}	
}

/**
 * @note 高级查询面板3点击监听事件
 * @author 吴义迪
 * @create_time 2017-08-06
 */
function advancedQuery3ClickFunc(e){
	e = e || window.event;
	var id = e.data.id;
	//退出
	if(e.target.id == "menu1_div_"+id+"_exit"){
		$("#tree_li_"+id+"_advancedQueryDiv").hide();
	}
	//时间尺度
	else if(e.target.attributes.name && e.target.attributes.name.nodeValue == "advancedQuery_time_span_"+id+""){
		//设置选中样式
		$("#advancedQuery_time_"+id+">span").css({"color":"", "background-color":""});
		e.target.style.color = "#fff";
		e.target.style.backgroundColor = "#4187e7";
		//设置选中状态
		$("#advancedQuery_time_"+id+">span").attr("flag", "0");
		e.target.attributes.flag.nodeValue = "1";
		//设置指标类型切换
		$("#advancedQuery_type_"+id+">div").hide();
		$("#advancedQuery_type_div"+e.target.attributes.index.nodeValue+"_"+id+"").show();
		
		//参数设置
		Global.common.param1 = $("#advancedQuery_time_"+id+">span[flag='1']").attr("param") + "," + $("#advancedQuery_type_div"+e.target.attributes.index.nodeValue+"_"+id+">span[flag='1']").attr("param");
		
		//要素控制判断图层是否有相应图层
		meteoShowTypeVisibility(id);
		
		//设置高级查询面板上偏移量
		setAdvancedQueryDivTop($("#tree_li_"+id+"_img5"), $("#tree_li_"+id+"_advancedQueryDiv"));
		
		//加载图层
		Config[id].initTimeAxisFlag = true;
		loadLayer(id);
	
	}
	//指标类型
	else if(e.target.attributes.name && e.target.attributes.name.nodeValue == "advancedQuery_type_span_"+id+""){
		var parentNodeId = e.target.parentNode.id;
		
		//设置选中样式
		$("#"+parentNodeId+">span").css({"color":"", "background-color":""});
		e.target.style.color = "#fff";
		e.target.style.backgroundColor = "#4187e7";
		//设置选中状态
		$("#"+parentNodeId+">span").attr("flag", "0");
		e.target.attributes.flag.nodeValue = "1";
		
		//参数设置
		Global.common.param1 = $("#advancedQuery_time_"+id+">span[flag='1']").attr("param") + "," + $("#"+parentNodeId+">span[flag='1']").attr("param");
		
		//要素控制判断图层是否有相应图层
		meteoShowTypeVisibility(id);
		
		//设置高级查询面板上偏移量
		setAdvancedQueryDivTop($("#tree_li_"+id+"_img5"), $("#tree_li_"+id+"_advancedQueryDiv"));
		
		//加载图层
		loadLayer(id);		
		
	}
	//离散点色斑图控制
	else if(e.target.attributes.name && e.target.attributes.name.nodeValue == "advancedQuery_showType_"+id+""){
		if(e.target.attributes.flag.nodeValue == "1"){
			//清除选中样式
			e.target.style.color = "";
			e.target.style.backgroundColor = "";
			//清除选中状态
			e.target.attributes.flag.nodeValue = "0";
			//清除图层
			if(e.target.attributes.param.nodeValue == "point"){
				var layers = Global.common.map.getLayersByName(Config.layerType9Name[0]);
				if(layers.length > 0){
					if($("#advancedQuery_meteoShowType_"+id+">span[param='label']").attr("flag") == "1"){
						for(var i=0; i<layers[0].features.length; i++){
							layers[0].features[i].style.pointRadius = "0";
						}
						layers[0].redraw();
					}else{
						layers[0].removeAllFeatures();
					}
				}
			}else if(e.target.attributes.param.nodeValue == "label"){
				var layers = Global.common.map.getLayersByName(Config.layerType9Name[0]);
				if(layers.length > 0){
					if($("#advancedQuery_meteoShowType_"+id+">span[param='point']").attr("flag") == "1"){
						for(var i=0; i<layers[0].features.length; i++){
							layers[0].features[i].style.fontOpacity = "0";
						}
						layers[0].redraw();
					}else{
						layers[0].removeAllFeatures();
					}
				}
			}else if(e.target.attributes.param.nodeValue == "isoGeo"){
				var layers = Global.common.map.getLayersByName(Config.layerType9Name[1]);
				if(layers.length > 0){
					layers[0].removeAllFeatures();
				}
			}
		}else{
			//设置选中样式
			e.target.style.color = "#fff";
			e.target.style.backgroundColor = "#4187e7";
			//设置选中状态
			e.target.attributes.flag.nodeValue = "1";
			//加载图层
			if(e.target.attributes.param.nodeValue == "point"){
				var layers = Global.common.map.getLayersByName(Config.layerType9Name[0]);
				if($("#advancedQuery_meteoShowType_"+id+">span[param='label']").attr("flag") == "1"){
					for(var i=0; i<layers[0].features.length; i++){
						layers[0].features[i].style.pointRadius = "5";
					}
					layers[0].redraw();
				}else{
					loadLayer(id);
				}
			}else if(e.target.attributes.param.nodeValue == "label"){
				var layers = Global.common.map.getLayersByName(Config.layerType9Name[0]);
				if($("#advancedQuery_meteoShowType_"+id+">span[param='point']").attr("flag") == "1"){
					for(var i=0; i<layers[0].features.length; i++){
						layers[0].features[i].style.fontOpacity = "1";
					}
					layers[0].redraw();
				}else{
					loadLayer(id);
				}
			}else{
				loadLayer(id);
			}
		}
	}
	//站点控制
	else if(e.target.attributes.name && e.target.attributes.name.nodeValue == "advancedQuery_stationType_"+id+""){
		if(e.target.attributes.flag.nodeValue == "1"){
			//清除选中样式
			e.target.style.color = "";
			e.target.style.backgroundColor = "";
			//清除选中状态
			e.target.attributes.flag.nodeValue = "0";
		}else{
			//设置选中样式
			e.target.style.color = "#fff";
			e.target.style.backgroundColor = "#4187e7";
			//设置选中状态
			e.target.attributes.flag.nodeValue = "1";
		}
		var layers = Global.common.map.getLayersByName(Config.layerType9Name[0]);;
		if(layers != null && layers.length > 0){
			var stationTypeArray = $("#advancedQuery_stationShowType_"+id+">span[flag=1]");
			var stationParam = [];
			for(var i=0; i<stationTypeArray.length; i++){
				stationParam.push(stationTypeArray[i].attributes.param.nodeValue);
			}
			for(var i=0; i<layers[0].features.length; i++){
				var stationDiaplay = "";
				if(stationParam.length > 0){
					for(var j=0; j<stationParam.length; j++){
						if(layers[0].features[i].info.stationType == stationParam[j]){
			    			break;
			    		}
						if(j == stationParam.length - 1){
			    			stationDiaplay = "none";
			    		}
					}
				}else{
					stationDiaplay = "none";
				}
				layers[0].features[i].style.display = stationDiaplay;
			}
			layers[0].redraw();
		}
		if($("#map_table").is(":visible")){
			showTxtProductIntoTable();
		}
	}
	//图层操作-查看数据
	else if(e.target.id == "advancedQuery_layerOperation_"+id+"_span1"){
		if($("#map_table").is(":visible")){
			$("#map_table").hide();
		}else{
			if(Global.common.micaps3Data == null){
				showPromptMessage("当前图层无数据");
			}else{
				showTxtProductIntoTable();
			}
		}
	}
	//图层操作-查看图片产品
	else if(e.target.id == "advancedQuery_layerOperation_"+id+"_span2"){
		showImgProduct(id);
	}
}

/**
 * @note 高级查询面板4点击监听事件
 * @author 吴义迪
 * @create_time 2017-08-12
 */
function advancedQuery4ClickFunc(e){
	e = e || window.event;
	var id = e.data.id;
	//退出
	if(e.target.id == "menu1_div_"+id+"_exit"){
		$("#tree_li_"+id+"_advancedQueryDiv").hide();
	}
	//指标类型
	else if(e.target.attributes.name && e.target.attributes.name.nodeValue == "advancedQuery_type_span_"+id+""){
		var parentNodeId = e.target.parentNode.id;
		
		//设置选中样式
		$("#"+parentNodeId+">span").css({"color":"", "background-color":""});
		e.target.style.color = "#fff";
		e.target.style.backgroundColor = "#4187e7";
		//设置选中状态
		$("#"+parentNodeId+">span").attr("flag", "0");
		e.target.attributes.flag.nodeValue = "1";
		
		//加载图层
		loadLayer(id);
	}
	//图层控制
	else if(e.target.attributes.name && e.target.attributes.name.nodeValue == "advancedQuery_meteoShow_span_"+id+""){
		if(e.target.attributes.flag.nodeValue == "1"){
			//清除选中样式
			e.target.style.color = "";
			e.target.style.backgroundColor = "";
			//清除选中状态
			e.target.attributes.flag.nodeValue = "0";
			var layers = Global.common.map.getLayersByName("layer_"+id+"");
			if(layers.length > 0){
				if(e.target.attributes.param.nodeValue == "label"){
					layers[0].isShowLabel = false;
				}else if(e.target.attributes.param.nodeValue == "line"){
					layers[0].isShowGridline = false;
				}
				layers[0].redraw();
			}
		}else{
			//设置选中样式
			e.target.style.color = "#fff";
			e.target.style.backgroundColor = "#4187e7";
			//设置选中状态
			e.target.attributes.flag.nodeValue = "1";
			var layers = Global.common.map.getLayersByName("layer_"+id+"");
			if(layers.length > 0){
				if(e.target.attributes.param.nodeValue == "label"){
					layers[0].isShowLabel = true;
				}else if(e.target.attributes.param.nodeValue == "line"){
					layers[0].isShowGridline = true;
				}
				layers[0].redraw();
			}
		}
	}
}

/**
 * @note 高级查询面板5点击监听事件
 * @author 吴义迪
 * @create_time 2017-10-16
 */
function advancedQuery5ClickFunc(e){
	e = e || window.event;
	var id = e.data.id;
	//退出
	if(e.target.id == "menu1_div_"+id+"_exit"){
		$("#tree_li_"+id+"_advancedQueryDiv").hide();
	}
	//当前生效
	else if(e.target.id == "yjxh_dqsx_a"){
		Global.common.yjxhWebSocketFlag = true;
		$("#yjxh_dqsx").show();
		$("#yjxh_tjcx").hide();
		showYJXHInfo(Global.common.yjxhJsonStr);
	}
	//条件查询
	else if(e.target.id == "yjxh_tjcx_a"){
		Global.common.yjxhWebSocketFlag = false;
		$("#yjxh_dqsx").hide();
		$("#yjxh_tjcx").show();
		showYJXHInfo2(Global.common.yjxhValue, true);
	}
	//当前生效-点击灾种
	else if((e.target.attributes.name && e.target.attributes.name.nodeValue == "yjxh_type" && e.target.parentNode.id == "yjxh_dqsx_div1") || (e.target.parentNode.attributes.name && e.target.parentNode.attributes.name.nodeValue == "yjxh_type" && e.target.parentNode.parentNode.id == "yjxh_dqsx_div1")){
		var target;
		if(e.target.attributes.name && e.target.attributes.name.nodeValue == "yjxh_type"){
			target = e.target;
		}else{
			target = e.target.parentNode;
		}
		if(target.attributes.flag.nodeValue == "all"){
			$("#yjxh_dqsx_div1>span[name='yjxh_type'][flag!='all']").attr("flag1", "0");
			if(target.attributes.flag1.nodeValue == "0"){
				target.attributes.flag1.nodeValue = "1";
			}else{
				target.attributes.flag1.nodeValue = "0";
			}
		}else if(target.attributes.flag1.nodeValue == "0"){
			target.attributes.flag1.nodeValue = "1";
			$("#yjxh_dqsx_div1>span[flag='all']").attr("flag1", "0");
		}else{
			target.attributes.flag1.nodeValue = "0";
			$("#yjxh_dqsx_div1>span[flag='all']").attr("flag1", "0");
		}
		var typeArr = [];
		for(var i=0; i<$("#yjxh_dqsx_div1>span[name='yjxh_type']").length; i++){
			if($("#yjxh_dqsx_div1>span[flag='all']").attr("flag1") == "0"){
				if($("#yjxh_dqsx_div1>span[name='yjxh_type']").eq(i).attr("flag1") == "0" && $("#yjxh_dqsx_div1>span[name='yjxh_type']").eq(i).attr("flag") != "all"){
					typeArr.push($("#yjxh_dqsx_div1>span[name='yjxh_type']").eq(i).attr("flag"));
				}
			}
			if($("#yjxh_dqsx_div1>span[name='yjxh_type']").eq(i).attr("flag1") == "0"){
				$("#yjxh_dqsx_div1>span[name='yjxh_type']").eq(i).children(".emfocus").hide();
			}else{
				$("#yjxh_dqsx_div1>span[name='yjxh_type']").eq(i).children(".emfocus").show();
			}
		}
		var value;
		if(typeof Global.common.yjxhJsonStr == "object"){
			value = Global.common.yjxhJsonStr.slice();
		}else{
			value = eval('('+Global.common.yjxhJsonStr+')');
		}
		
		var areaCode = $("#yjxh_dqsx_select>option:selected").attr("code");
		for(var i=0; i<value.length; i++){
			for(var j=0; j<typeArr.length; j++){
				if(value[i].eventtype + "_" + value[i].level == typeArr[j]){
					value.splice(i--, 1);
					break;
				}
			}
		}
		for(var i=0; i<value.length; i++){
			if(value[i].id.substring(0,6) != areaCode && areaCode != "000000"){
				value.splice(i--, 1);
			}
		}
		showYJXHInfo1(value, false);
	}
	//条件查询-点击灾种
	else if((e.target.attributes.name && e.target.attributes.name.nodeValue == "yjxh_type" && e.target.parentNode.id == "yjxh_tjcx_div1") || (e.target.parentNode.attributes.name && e.target.parentNode.attributes.name.nodeValue == "yjxh_type" && e.target.parentNode.parentNode.id == "yjxh_tjcx_div1")){
		var target;
		if(e.target.attributes.name && e.target.attributes.name.nodeValue == "yjxh_type"){
			target = e.target;
		}else{
			target = e.target.parentNode;
		}
		if(target.attributes.flag.nodeValue == "all"){
			$("#yjxh_tjcx_div1>span[name='yjxh_type'][flag!='all']").attr("flag1", "0");
			if(target.attributes.flag1.nodeValue == "0"){
				target.attributes.flag1.nodeValue = "1";
			}else{
				target.attributes.flag1.nodeValue = "0";
			}
		}else if(target.attributes.flag1.nodeValue == "0"){
			target.attributes.flag1.nodeValue = "1";
			$("#yjxh_tjcx_div1>span[flag='all']").attr("flag1", "0");
		}else{
			target.attributes.flag1.nodeValue = "0";
			$("#yjxh_tjcx_div1>span[flag='all']").attr("flag1", "0");
		}
		var typeArr = [];
		for(var i=0; i<$("#yjxh_tjcx_div1>span[name='yjxh_type']").length; i++){
			if($("#yjxh_tjcx_div1>span[flag='all']").attr("flag1") == "0"){
				if($("#yjxh_tjcx_div1>span[name='yjxh_type']").eq(i).attr("flag1") == "0" && $("#yjxh_tjcx_div1>span[name='yjxh_type']").eq(i).attr("flag") != "all"){
					typeArr.push($("#yjxh_tjcx_div1>span[name='yjxh_type']").eq(i).attr("flag"));
				}
			}
			if($("#yjxh_tjcx_div1>span[name='yjxh_type']").eq(i).attr("flag1") == "0"){
				$("#yjxh_tjcx_div1>span[name='yjxh_type']").eq(i).children(".emfocus").hide();
			}else{
				$("#yjxh_tjcx_div1>span[name='yjxh_type']").eq(i).children(".emfocus").show();
			}
		}
		var value = Global.common.yjxhValue.slice();
		for(var i=0; i<value.length; i++){
			for(var j=0; j<typeArr.length; j++){
				if(value[i].eventtype + "_" + value[i].level == typeArr[j]){
					value.splice(i--, 1);
					break;
				}
			}
		}
		showYJXHInfo2(value, false);
	}
	//预警信息查询
	else if(e.target.id == "yjxh_query"){
		$("#yjxh_query").html("查询中...");
		$("#yjxh_query").attr("disabled", true);
		if($("#yjxh_startime").val() > $("#yjxh_endtime").val()){
			alert("开始时间不能大于结束时间");
		}
		var param = {};
		var code = $("#Area>option:selected").val();
		if(code != "000000"){
			if($("#Area>option:selected").val().substring(4,6) == "00"){
				param.areaFlag = "1";
			}
			param.areaCode = $("#Area>option:selected").val();
		}
		if($("#yjxh_startime").val() != ""){
			var arr = $("#yjxh_startime").val().split("-");
			param.startime = arr[0]+arr[1]+arr[2];
		}
		if($("#yjxh_endtime").val() != ""){
			var arr1 = $("#yjxh_endtime").val().split("-");
			param.endtime = arr1[0]+arr1[1]+arr1[2];
		}
		requestYJXHInfo1(param);
	}
}

/**
 * @note 高级查询面板6点击监听事件
 * @author 吴义迪
 * @create_time 2018-01-16
 */
function advancedQuery6ClickFunc(e){
	e = e || window.event;
	var id = e.data.id;
	//退出
	if(e.target.id == "menu1_div_"+id+"_exit"){
		$("#tree_li_"+id+"_advancedQueryDiv").hide();
	}
	else if($(e.target).attr("name") == "advancedQuery_type_span_"+id+""){
		if($(e.target).attr("flag") == "1"){
			$(e.target).attr("flag", "0");
			$(e.target).css({"background":"#CD5C5C", "color":"#fff"});
			if($(e.target).attr("value") != "" && $(e.target).attr("value") != null){
				var valueArr = $(e.target).attr("value").split(";");
				var layerType10FlagArr = [];
				for(var i=0; i<valueArr.length; i++){
					var value = valueArr[i].split(",");
					layerType10FlagArr.push(value[0]);
				}
				var layers = Global.common.map.getLayersByName("layer_" + id);
				var fs = [];
				if(layers != null && layers.length > 0){
					for(var i=0; i<layers[0].features.length; i++){
						for(var j=0; j<layerType10FlagArr.length; j++){
							if(layers[0].features[i].info.superpositionFlag == layerType10FlagArr[j]){
								fs.push(layers[0].features[i]);
							}
						}
					}
				}
				layers[0].removeFeatures(fs);
			}
		}else if($(e.target).attr("flag") == "0"){
			$(e.target).attr("flag", "1");
			$(e.target).css({"background":"#4187e7", "color":"#fff"});
			if($(e.target).attr("value") != "" && $(e.target).attr("value") != null){
				var valueArr = $(e.target).attr("value").split(";");
				var layerType10FlagArr = [];
				var labelX = [];
				var labelY = [];
				var color = [];
				var labelAlign = [];
				for(var i=0; i<valueArr.length; i++){
					var value = valueArr[i].split(",");
					layerType10FlagArr.push(value[0]);
					labelX.push(value[1]);
					labelY.push(value[2]);
					color.push(value[3]);
					labelAlign.push(value[4]);
				}
				showSuperposition(id, "Station_Name,Station_Id_C,Lon,Lat", layerType10FlagArr, labelX, labelY, color, labelAlign);
			}
		}
	}
	else if($(e.target).attr("id") == "advancedQuery_type_span_w1_"+id+""){
		if($(e.target).attr("flag") == "1"){
			$(e.target).attr("flag", "0");
			$(e.target).css({"background":"#CD5C5C", "color":"#fff"});
			if($(e.target).attr("value") != "" && $(e.target).attr("value") != null){
				var valueArr = $(e.target).attr("value").split(";");
				var layerType10FlagArr = [];
				for(var i=0; i<valueArr.length; i++){
					var value = valueArr[i].split(",");
					layerType10FlagArr.push(value[0]);
				}
				var layers = Global.common.map.getLayersByName("layer_" + id);
				var fs = [];
				if(layers != null && layers.length > 0){
					for(var i=0; i<layers[0].features.length; i++){
						for(var j=0; j<layerType10FlagArr.length; j++){
							if(layers[0].features[i].info.superpositionFlag == layerType10FlagArr[j]){
								fs.push(layers[0].features[i]);
							}
						}
					}
				}
				layers[0].removeFeatures(fs);
			}
		}else if($(e.target).attr("flag") == "0"){
			$(e.target).attr("flag", "1");
			$(e.target).css({"background":"#4187e7", "color":"#fff"});
			if($("#advancedQuery_type_span_w2_"+id+"").attr("flag") == "1"){
				$("#advancedQuery_type_span_w2_"+id+"").attr("flag", "0");
				$("#advancedQuery_type_span_w2_"+id+"").css({"background":"#CD5C5C", "color":"#fff"});
				if($("#advancedQuery_type_span_w2_"+id+"").attr("value") != "" && $(e.target).attr("value") != null){
					var valueArr = $("#advancedQuery_type_span_w2_"+id+"").attr("value").split(";");
					var layerType10FlagArr = [];
					for(var i=0; i<valueArr.length; i++){
						var value = valueArr[i].split(",");
						layerType10FlagArr.push(value[0]);
					}
					var layers = Global.common.map.getLayersByName("layer_" + id);
					var fs = [];
					if(layers != null && layers.length > 0){
						for(var i=0; i<layers[0].features.length; i++){
							for(var j=0; j<layerType10FlagArr.length; j++){
								if(layers[0].features[i].info.superpositionFlag == layerType10FlagArr[j]){
									fs.push(layers[0].features[i]);
								}
							}
						}
					}
					layers[0].removeFeatures(fs);
				}
			}
			if($(e.target).attr("value") != "" && $(e.target).attr("value") != null){
				var valueArr = $(e.target).attr("value").split(";");
				var layerType10FlagArr = [];
				var labelX = [];
				var labelY = [];
				var color = [];
				var labelAlign = [];
				for(var i=0; i<valueArr.length; i++){
					var value = valueArr[i].split(",");
					layerType10FlagArr.push(value[0]);
					labelX.push(value[1]);
					labelY.push(value[2]);
					color.push(value[3]);
					labelAlign.push(value[4]);
				}
				showSuperposition(id, "Station_Name,Station_Id_C,Lon,Lat", layerType10FlagArr, labelX, labelY, color, labelAlign);
			}
		}
	}
	else if($(e.target).attr("id") == "advancedQuery_type_span_w2_"+id+""){
		if($(e.target).attr("flag") == "1"){
			$(e.target).attr("flag", "0");
			$(e.target).css({"background":"#CD5C5C", "color":"#fff"});
			if($(e.target).attr("value") != "" && $(e.target).attr("value") != null){
				var valueArr = $(e.target).attr("value").split(";");
				var layerType10FlagArr = [];
				for(var i=0; i<valueArr.length; i++){
					var value = valueArr[i].split(",");
					layerType10FlagArr.push(value[0]);
				}
				var layers = Global.common.map.getLayersByName("layer_" + id);
				var fs = [];
				if(layers != null && layers.length > 0){
					for(var i=0; i<layers[0].features.length; i++){
						for(var j=0; j<layerType10FlagArr.length; j++){
							if(layers[0].features[i].info.superpositionFlag == layerType10FlagArr[j]){
								fs.push(layers[0].features[i]);
							}
						}
					}
				}
				layers[0].removeFeatures(fs);
			}
		}else if($(e.target).attr("flag") == "0"){
			$(e.target).attr("flag", "1");
			$(e.target).css({"background":"#4187e7", "color":"#fff"});
			if($("#advancedQuery_type_span_w1_"+id+"").attr("flag") == "1"){
				$("#advancedQuery_type_span_w1_"+id+"").attr("flag", "0");
				$("#advancedQuery_type_span_w1_"+id+"").css({"background":"#CD5C5C", "color":"#fff"});
				if($("#advancedQuery_type_span_w1_"+id+"").attr("value") != "" && $(e.target).attr("value") != null){
					var valueArr = $("#advancedQuery_type_span_w1_"+id+"").attr("value").split(";");
					var layerType10FlagArr = [];
					for(var i=0; i<valueArr.length; i++){
						var value = valueArr[i].split(",");
						layerType10FlagArr.push(value[0]);
					}
					var layers = Global.common.map.getLayersByName("layer_" + id);
					var fs = [];
					if(layers != null && layers.length > 0){
						for(var i=0; i<layers[0].features.length; i++){
							for(var j=0; j<layerType10FlagArr.length; j++){
								if(layers[0].features[i].info.superpositionFlag == layerType10FlagArr[j]){
									fs.push(layers[0].features[i]);
								}
							}
						}
					}
					layers[0].removeFeatures(fs);
				}
			}
			if($(e.target).attr("value") != "" && $(e.target).attr("value") != null){
				var valueArr = $(e.target).attr("value").split(";");
				var layerType10FlagArr = [];
				var labelX = [];
				var labelY = [];
				var color = [];
				var labelAlign = [];
				for(var i=0; i<valueArr.length; i++){
					var value = valueArr[i].split(",");
					layerType10FlagArr.push(value[0]);
					labelX.push(value[1]);
					labelY.push(value[2]);
					color.push(value[3]);
					labelAlign.push(value[4]);
				}
				showSuperposition(id, "Station_Name,Station_Id_C,Lon,Lat", layerType10FlagArr, labelX, labelY, color, labelAlign);
			}
		}
	}
	//站点控制
	else if(e.target.attributes.name && e.target.attributes.name.nodeValue == "advancedQuery_stationType_"+id+""){
		if(e.target.attributes.flag.nodeValue == "1"){
			//清除选中样式
			e.target.style.color = "";
			e.target.style.backgroundColor = "";
			//清除选中状态
			e.target.attributes.flag.nodeValue = "0";
		}else{
			//设置选中样式
			e.target.style.color = "#fff";
			e.target.style.backgroundColor = "#4187e7";
			//设置选中状态
			e.target.attributes.flag.nodeValue = "1";
		}
		var layers = Global.common.map.getLayersByName("layer_" + id);;
		if(layers != null && layers.length > 0){
			var stationTypeArray = $("#advancedQuery_stationShowType_"+id+">span[flag=1]");
			var stationParam = [];
			for(var i=0; i<stationTypeArray.length; i++){
				stationParam.push(stationTypeArray[i].attributes.param.nodeValue);
			}
			for(var i=0; i<layers[0].features.length; i++){
				var stationDiaplay = "";
				if(stationParam.length > 0){
					for(var j=0; j<stationParam.length; j++){
						if(layers[0].features[i].info.stationType == stationParam[j]){
			    			break;
			    		}
						if(j == stationParam.length - 1){
			    			stationDiaplay = "none";
			    		}
					}
				}else{
					stationDiaplay = "none";
				}
				layers[0].features[i].style.display = stationDiaplay;
			}
			layers[0].redraw();
		}
		if($("#map_table").is(":visible")){
			showTxtProductIntoTable();
		}
	}
}

/**
 * @note 预警信号区域切换
 * @author 吴义迪
 * @create_time 2017-10-18
 */
function yjxhAreaChangeFunc(){
	var typeArr = [];
	for(var i=0; i<$("#yjxh_dqsx_div1>span[name='yjxh_type']").length; i++){
		if($("#yjxh_dqsx_div1>span[flag='all']").attr("flag1") == "0"){
			if($("#yjxh_dqsx_div1>span[name='yjxh_type']").eq(i).attr("flag1") == "0" && $("#yjxh_dqsx_div1>span[name='yjxh_type']").eq(i).attr("flag") != "all"){
				typeArr.push($("#yjxh_dqsx_div1>span[name='yjxh_type']").eq(i).attr("flag"));
			}
		}
	}
	var value;
	if(typeof Global.common.yjxhJsonStr == "object"){
		value = Global.common.yjxhJsonStr.slice();
	}else{
		value = eval('('+Global.common.yjxhJsonStr+')');
	}
	
	var areaCode = $("#yjxh_dqsx_select>option:selected").attr("code");
	for(var i=0; i<value.length; i++){
		if(value[i].id.substring(0,6) != areaCode && areaCode != "000000"){
			value.splice(i--, 1);
		}
	}
	showYJXHInfo1(value, true);
}

/**
 * @note 高级查询-展示预警信号信息
 * @author 吴义迪
 * @create_time 2017-10-17
 */
function showYJXHInfo1(jsonStr, showFlag){
	if(jsonStr != null){
		var value = jsonStr;
		var layers = Global.common.map.getLayersByName(Config.layerType8Name[0]);
		if(layers.length > 0){
			layers[0].removeAllFeatures();
		}else{
			layers.push(new SuperMap.Layer.Vector(Config.layerType8Name[0]));
			Global.common.map.addLayer(layers[0]);
			Global.common.selectFeatureLayers.push(layers[0]);
			Global.common.selectFeature.setLayer(Global.common.selectFeatureLayers);
			refreshSelectCluster();
		}
		var fs = [];
		var geometry = [];
		var level1 = 0;
		var level2 = 0;
		var level3 = 0;
		var level4 = 0;
		var areaCount1 = 0;
		var areaCount2 = 0;
		var areaCount3 = 0;
		var eventValue = [];
		eventValue.push({"flag":"all", "img":"resources/images/indexMap/all_blue.png", "count":value.length, "note":"全部预警"});
		var eventStr = "";
		for(var i=0; i<value.length; i++){
			var f = new SuperMap.Feature.Vector();
			var lon = parseFloat(value[i].lon);
			var lat = parseFloat(value[i].lat);
			//处理预警信息位置相同情况
			if(geometry.length <= 0){
				geometry.push({"lon":value[i].lon, "lat":value[i].lat});
			}else{
				for(var k=0; k<geometry.length; k++){
					if(geometry[k].lon == value[i].lon && geometry[k].lat == value[i].lat){
						lon += Math.random()*0.1;
						lat += Math.random()*0.1;
						break;
					}
					if(k == (geometry.length-1)){
						geometry.push({"lon":value[i].lon, "lat":value[i].lat});
					}
				}
			}
			f.geometry = new SuperMap.Geometry.Point(lon, lat).transform("EPSG:"+Global.transform.source+"","EPSG:"+Global.transform.dest+"");
			var imgFlag = "";
			var imgUrl = "";
			for(var j=0; j<Global.monitor.yjxh.length; j++){
				if(typeof value[i].title == "string" && value[i].title.indexOf(Global.monitor.yjxh[j].name) >= 0 && value[i].title.indexOf(Global.monitor.yjxh[j].level) >= 0){
					imgFlag = Global.monitor.yjxh[j].flag;
					break;
				}
			}
			for(var j=0; j<Global.monitor.imgUrl.length; j++){
				if(imgFlag == Global.monitor.imgUrl[j].name){
					imgUrl = Global.monitor.imgUrl[j].value;
					break;
				}
			}
			if(imgUrl == ""){
				if(typeof value[i].title == "string" && value[i].title.indexOf("蓝色") >= 0){
					imgUrl = "resources/images/indexMap/adefault_blue.png";
				}else if(typeof value[i].title == "string" && value[i].title.indexOf("黄色") >= 0){
					imgUrl = "resources/images/indexMap/adefault_yellow.png";
				}else if(typeof value[i].title == "string" && value[i].title.indexOf("橙色") >= 0){
					imgUrl = "resources/images/indexMap/adefault_orange.png";
				}else if(typeof value[i].title == "string" && value[i].title.indexOf("红色") >= 0){
					imgUrl = "resources/images/indexMap/adefault_red.png";
				}
			}
			if(eventStr.indexOf(value[i].eventtype + "_" + value[i].level) < 0){
				var level;
				if(value[i].level == Global.common.yjxh_level[0]){
					level = "红";
				}else if(value[i].level == Global.common.yjxh_level[1]){
					level = "橙";
				}else if(value[i].level == Global.common.yjxh_level[2]){
					level = "黄";
				}else if(value[i].level == Global.common.yjxh_level[3]){
					level = "蓝";
				}
				eventValue.push({"flag":value[i].eventtype+"_"+value[i].level, "img":imgUrl, "count":1, "note":value[i].disaster+"·"+level});
				eventStr += value[i].eventtype + "_" + value[i].level + ",";
			}else{
				for(var k=0; k<eventValue.length; k++){
					if(eventValue[k].flag == value[i].eventtype+ "_" + value[i].level){
						eventValue[k].count++;
						break;
					}
				}
			}
			
			f.style = {
				graphic: true,
				externalGraphic: imgUrl,
				graphicWidth: 24,
				graphicHeight: 24,
	        };
			f.info = {
				layerId: "yjxh",
				eventtype: value[i].eventtype,
				title: value[i].title,
				content: value[i].content,
				alertId: value[i].id,
				level: value[i].level,
				msgtype: value[i].msgtype
			};
			fs.push(f);
			
			//统计分析
			if(value[i].level == Global.common.yjxh_level[0]){
				level1 ++;
			}else if(value[i].level == Global.common.yjxh_level[1]){
				level2 ++;
			}else if(value[i].level == Global.common.yjxh_level[2]){
				level3 ++;
			}else if(value[i].level == Global.common.yjxh_level[3]){
				level4 ++;
			}
			if(value[i].id.substring(2,6) == "0000"){
				areaCount1 ++;
			}else if(value[i].id.substring(4,6) == "00"){
				areaCount2 ++;
			}else{
				areaCount3 ++;
			}
		}
		layers[0].addFeatures(fs);
		//绘制统计分析图
		$("#zhfw-yjxh-count").html(value.length);
		$("#zhfw-tjcx-count1").html(value.length);
		$("#zhfw-yjxh-count1").html(areaCount1);
		$("#zhfw-yjxh-count2").html(areaCount2);
		$("#zhfw-yjxh-count3").html(areaCount3);
		var myChart = echarts.init(document.getElementById('ring'));
        option = {
            legend: {
                orient: 'vertical',
                right: 10,
                top: 20,
                data:['红色预警','橙色预警','黄色预警','蓝色预警'],
                color: ['red', 'orange', 'yellow', 'blue'],//饼图颜色
            },
            series: [
                {
                    name:'访问来源',
                    type:'pie',
                    radius: ['40%', '60%'],
                    center: ['35%', '50%'],
                    label: {
                        normal: {
                            show: true,
                            color: '#000'
                        },
                        emphasis: {
                            show: true,
                            textStyle: {
                                fontSize: '14',
                                fontWeight: 'bold',
                                color:'#000'
                            }
                        }
                    },
                    itemStyle: {
                        normal: {
                            label: {
                                show: true,
                                formatter: "{c}条",
                                width: 1
                            },

                            labelLine: {
                                show: true
                            }
                        }

                    },
                    data:[
                        {value:level1, name:'红色预警'},
                        {value:level2, name:'橙色预警'},
                        {value:level3, name:'黄色预警'},
                        {value:level4, name:'蓝色预警'}
                    ],
                    color: ['red', 'orange', 'yellow', 'blue'],//饼图颜色
                }
            ]
        };
        myChart.setOption(option);
        $("#zhfw-yjxh-area").html($("#yjxh_dqsx_select>option:selected").html()+"当前生效");
        $("#zhfw-yjxh-area1").html($("#yjxh_dqsx_select>option:selected").html()+"当前生效");
        
        if(showFlag == true){
        	var html = "";
        	for(var l=0; l<eventValue.length; l++){
        		if(l !=0 && l%3 == 0){
        			html += "<br>";
        		}
        		if(l < 3){
        			if(l == 0){
        				html += "<span name=\"yjxh_type\" flag=\""+eventValue[l].flag+"\" flag1=\"1\" title=\""+eventValue[l].note+"\" style=\"position:relative;cursor:pointer;display:inline-block;text-align:center;width:75px;height:65px;border:1px solid #ddd;\">" +
		        				"	<img src=\""+eventValue[l].img+"\" style=\"width:36px;height:30px;display:inline-block;margin:8px 0 0 5px;\">" +
		        				"	<br>" +
		        				"	<span class=\"yjxh_span\">"+eventValue[l].note+"</span>" +
		        				"	<span class=\"yjxh_span1\">"+eventValue[l].count+"</span>" +
		        				"	<em class=\"emfocus\"></em>" +
		        				"</span>";
        			}else{
        				html += "<span name=\"yjxh_type\" flag=\""+eventValue[l].flag+"\" flag1=\"0\" title=\""+eventValue[l].note+"\" style=\"position:relative;cursor:pointer;display:inline-block;text-align:center;width:75px;height:65px;border-top:1px solid #ddd;border-right:1px solid #ddd;border-bottom:1px solid #ddd;\">" +
		        				"	<img src=\""+eventValue[l].img+"\" style=\"width:36px;height:30px;display:inline-block;margin:8px 0 0 5px;\">" +
		        				"	<br>" +
		        				"	<span class=\"yjxh_span\">"+eventValue[l].note+"</span>" +
		        				"	<span class=\"yjxh_span1\">"+eventValue[l].count+"</span>" +
		        				"	<em class=\"emfocus\"></em>" +
		        				"</span>";
        			}
        		}else{
        			if(l % 3 == 0){
        				html += "<span name=\"yjxh_type\" flag=\""+eventValue[l].flag+"\" flag1=\"0\" title=\""+eventValue[l].note+"\" style=\"position:relative;cursor:pointer;display:inline-block;text-align:center;width:75px;height:65px;border-left:1px solid #ddd;border-bottom:1px solid #ddd;border-right:1px solid #ddd;\">" +
		        				"	<img src=\""+eventValue[l].img+"\" style=\"width:36px;height:30px;display:inline-block;margin:8px 0 0 5px;\">" +
		        				"	<br>" +
		        				"	<span class=\"yjxh_span\">"+eventValue[l].note+"</span>" +
		        				"	<span class=\"yjxh_span1\">"+eventValue[l].count+"</span>" +
		        				"	<em class=\"emfocus\"></em>" +
		        				"</span>";
        			}else{
        				html += "<span name=\"yjxh_type\" flag=\""+eventValue[l].flag+"\" flag1=\"0\" title=\""+eventValue[l].note+"\" style=\"position:relative;cursor:pointer;display:inline-block;text-align:center;width:75px;height:65px;border-bottom:1px solid #ddd;border-right:1px solid #ddd;\">" +
		        				"	<img src=\""+eventValue[l].img+"\" style=\"width:36px;height:30px;display:inline-block;margin:8px 0 0 5px;\">" +
		        				"	<br>" +
		        				"	<span class=\"yjxh_span\">"+eventValue[l].note+"</span>" +
		        				"	<span class=\"yjxh_span1\">"+eventValue[l].count+"</span>" +
		        				"	<em class=\"emfocus\"></em>" +
		        				"</span>";
        			}
        		}
        	}
        	if(eventValue.length < 3){
        		for(var b=0; b<3-eventValue.length; b++){
        			html += "<span style=\"background:#eee;display:inline-block;width:75px;height:65px;border-top:1px solid #ddd;border-bottom:1px solid #ddd;border-right:1px solid #ddd;\">" +
		        			"	<span class=\"yjxh_zw_span\"></span>" +
        					"</span>";
        		}
        	}else{
        		for(var b=0; b<3-eventValue.length%3 && eventValue.length%3 != 0; b++){
        			html += "<span style=\"background:#eee;display:inline-block;width:75px;height:65px;border-bottom:1px solid #ddd;border-right:1px solid #ddd;\">" +
		        			"	<span class=\"yjxh_zw_span\"></span>" +
							"</span>";
        		}
        	}
        	$("#yjxh_dqsx_div1").html(html);
        	setAdvancedQueryDivTop($("#tree_li_58_img5"), $("#tree_li_58_advancedQueryDiv"));
        	if($("#yjxh_dqsx_div1>span[flag='all']").attr("flag1") == "1"){
        		$("#yjxh_dqsx_div1>span[flag='all']").children(".emfocus").show();
        	}
        }
        loadYjxhList(value);
	}
}

/**
 * @note 透明度滑块位置改变时调用该方法
 * @author 吴义迪
 * @create_time 2017-07-30
 */
function refreshSlider(e) {
	e = e || window.event;
	var id = "";
	if(e && e.target && e.target.attributes && e.target.attributes.value){
		id = e.target.attributes.value.nodeValue;
	}
	$("#opacitySliderValue_"+id+"").html($("#opacitySlider_"+id+"").slider("value") + "%");
	$("#tree_li_"+id+"").attr("opacity", $("#opacitySlider_"+id+"").slider("value"));
	
	var layers = null;
	var layers1 = null;
	var layers2 = null;
	if(Config.layerType9.indexOf(","+id+",") >= 0){
		layers1 = Global.common.map.getLayersByName(Config.layerType9Name[0]);
		layers2 = Global.common.map.getLayersByName(Config.layerType9Name[1]);
	}else{
		layers = Global.common.map.getLayersByName("layer_"+id+"");
	}
	//设置图层透明度
	if(layers && layers.length > 0){
		layers[0].setOpacity($("#opacitySlider_"+id+"").slider("value") * 0.01);
	}
	if(layers1 && layers1.length > 0){
		layers1[0].setOpacity($("#opacitySlider_"+id+"").slider("value") * 0.01);
	}
	if(layers2 && layers2.length > 0){
		layers2[0].setOpacity($("#opacitySlider_"+id+"").slider("value") * 0.01);
	}
	$(".legendColor_div_"+id+"").each(function(){
		this.style.opacity = $("#opacitySlider_"+id+"").slider("value") * 0.01;
	});
	if(Global.common.legend.length > 0 && Global.common.legend[Global.common.legend.length-1].id == id){
		$("#legend-content>.legend_span").css("opacity", $("#opacitySlider_"+id+"").slider("value") * 0.01);
	}
}